hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4f290b5393ecf282853ddf3615e96d6107c6c389 | 2,141 | py | Python | fluent/widget/shape/box.py | breitburg/fluent | 3ad61f0b741a9890fd7542485a887b4dfcaf0e3c | [
"BSD-3-Clause"
] | 56 | 2020-05-08T16:23:47.000Z | 2021-11-09T11:40:48.000Z | fluent/widget/shape/box.py | libfluent/fluent | 3ad61f0b741a9890fd7542485a887b4dfcaf0e3c | [
"BSD-3-Clause"
] | null | null | null | fluent/widget/shape/box.py | libfluent/fluent | 3ad61f0b741a9890fd7542485a887b4dfcaf0e3c | [
"BSD-3-Clause"
] | 3 | 2020-05-14T23:31:06.000Z | 2021-06-06T18:59:52.000Z | from sdl2.sdlgfx import boxRGBA, roundedBoxRGBA, \
rectangleRGBA, roundedRectangleRGBA
from fluent.core.property import Color
from fluent.core.widget import RenderWidget
from fluent.core.window import window
class FilledBox(RenderWidget):
def __init__(self, size, color=Color(red=255, green=255, blue=255)):
... | 32.938462 | 90 | 0.621672 |
ff16a46780bb73952d428564fa439460b763af6a | 932 | py | Python | Solutions/0135.candy.py | lyhshang/LeetCode-Solutions | ecd4f193567bf87c9805f5ee871db9a7e1f3e9df | [
"Apache-2.0"
] | null | null | null | Solutions/0135.candy.py | lyhshang/LeetCode-Solutions | ecd4f193567bf87c9805f5ee871db9a7e1f3e9df | [
"Apache-2.0"
] | null | null | null | Solutions/0135.candy.py | lyhshang/LeetCode-Solutions | ecd4f193567bf87c9805f5ee871db9a7e1f3e9df | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# author:lyh
# datetime:2020/7/8 18:29
"""
135. 分发糖果
老师想给孩子们分发糖果,有 N 个孩子站成了一条直线,老师会根据每个孩子的表现,预先给他们评分。
你需要按照以下要求,帮助老师给这些孩子分发糖果:
每个孩子至少分配到 1 个糖果。
相邻的孩子中,评分高的孩子必须获得更多的糖果。
那么这样下来,老师至少需要准备多少颗糖果呢?
示例 1:
输入: [1,0,2]
输出: 5
解释: 你可以分别给这三个孩子分发 2、1、2 颗糖果。
示例 2:
输入: [1,2,2]
输出: 4
解释: 你可以分别给这三... | 19.416667 | 48 | 0.565451 |
3f859524f32a342b25e63728dba7877e0d8884b2 | 3,441 | py | Python | src/viztracer/report_builder.py | MaxCodeXTC/viztracer | fb37d5e04a7d1d94fe46f5b536c1e827965c595e | [
"Apache-2.0"
] | 1 | 2020-11-04T03:17:40.000Z | 2020-11-04T03:17:40.000Z | src/viztracer/report_builder.py | MaxCodeXTC/viztracer | fb37d5e04a7d1d94fe46f5b536c1e827965c595e | [
"Apache-2.0"
] | null | null | null | src/viztracer/report_builder.py | MaxCodeXTC/viztracer | fb37d5e04a7d1d94fe46f5b536c1e827965c595e | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/gaogaotiantian/viztracer/blob/master/NOTICE.txt
from string import Template
import os
import io
try:
import orjson as json
except ImportError:
import json
from .util import size_fmt, color_print
... | 35.84375 | 144 | 0.596338 |
3eec35c2d6b74a7cd1ee67e22b9ab1c940f12ca0 | 1,349 | py | Python | src/build_bcrypt.py | balabit-deps/balabit-os-7-python-bcrypt | bf0105f1a09bd668e6f61a5497ae528cd0877080 | [
"Apache-2.0"
] | null | null | null | src/build_bcrypt.py | balabit-deps/balabit-os-7-python-bcrypt | bf0105f1a09bd668e6f61a5497ae528cd0877080 | [
"Apache-2.0"
] | null | null | null | src/build_bcrypt.py | balabit-deps/balabit-os-7-python-bcrypt | bf0105f1a09bd668e6f61a5497ae528cd0877080 | [
"Apache-2.0"
] | 1 | 2019-11-12T21:53:56.000Z | 2019-11-12T21:53:56.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | 29.977778 | 74 | 0.687917 |
be9f1770ef0656cceb345959008f27ad3ce2df96 | 1,404 | py | Python | netrd/distance/hamming.py | Carromattsson/netrd | ec3360b5a9e241f318d7c8e729db3aeed9f2e5b7 | [
"MIT"
] | null | null | null | netrd/distance/hamming.py | Carromattsson/netrd | ec3360b5a9e241f318d7c8e729db3aeed9f2e5b7 | [
"MIT"
] | null | null | null | netrd/distance/hamming.py | Carromattsson/netrd | ec3360b5a9e241f318d7c8e729db3aeed9f2e5b7 | [
"MIT"
] | null | null | null | """
hamming.py
--------------
Hamming distance, wrapper for scipy function:
https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.hamming.html#scipy.spatial.distance.hamming
"""
import scipy
import numpy as np
import networkx as nx
from .base import BaseDistance
class Hamming(BaseDistance):
... | 26 | 119 | 0.606838 |
7e4820bb99d3d8c3ad45c2b7ec4c0557d1995c55 | 3,593 | py | Python | dog_breed_classifier/dogs.py | jciupis/dl-upc | 790f36d4f3e939cd5195414e9572db3eb97a2f0c | [
"MIT"
] | null | null | null | dog_breed_classifier/dogs.py | jciupis/dl-upc | 790f36d4f3e939cd5195414e9572db3eb97a2f0c | [
"MIT"
] | null | null | null | dog_breed_classifier/dogs.py | jciupis/dl-upc | 790f36d4f3e939cd5195414e9572db3eb97a2f0c | [
"MIT"
] | null | null | null | import json
import numpy as np
import util
class Dogs:
"""
The Dog class represents the Stanford dogs dataset in a neural network friendly way.
"""
def __init__(self, image_width=64, image_height=64):
"""
The constructor loads the one hot encodings and image annotations.
:param... | 36.292929 | 107 | 0.650431 |
ecc63cc85e12fbbd2bae9b4fb074d6b796f24a7c | 5,348 | py | Python | openpyexcel/chart/tests/test_bar_chart.py | sciris/openpyexcel | 1fde667a1adc2f4988279fd73a2ac2660706b5ce | [
"MIT"
] | 2 | 2019-07-03T06:37:42.000Z | 2020-05-15T00:28:13.000Z | openpyexcel/chart/tests/test_bar_chart.py | sciris/openpyexcel | 1fde667a1adc2f4988279fd73a2ac2660706b5ce | [
"MIT"
] | null | null | null | openpyexcel/chart/tests/test_bar_chart.py | sciris/openpyexcel | 1fde667a1adc2f4988279fd73a2ac2660706b5ce | [
"MIT"
] | 1 | 2020-01-06T10:01:42.000Z | 2020-01-06T10:01:42.000Z | from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyexcel
import pytest
from openpyexcel.xml.functions import tostring, fromstring
from openpyexcel.tests.helper import compare_xml
@pytest.fixture
def BarChart():
from ..bar_chart import BarChart
return BarChart
class TestBarChart:
d... | 28.296296 | 84 | 0.463538 |
56591fca7feca0e80689a2c9fbb918445e12ab84 | 1,236 | py | Python | packages/gtmapi/lmsrvlabbook/api/objects/apphealth.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | packages/gtmapi/lmsrvlabbook/api/objects/apphealth.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | packages/gtmapi/lmsrvlabbook/api/objects/apphealth.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | import graphene
from gtmcore.logging import LMLogger
from lmsrvcore.telemetry import service_telemetry
logger = LMLogger.get_logger()
class AppHealthMonitor(graphene.ObjectType, interfaces=(graphene.relay.Node,)):
"""A type that represents a Base Image Environment Component"""
# Representation of how many ... | 30.146341 | 79 | 0.717638 |
993ceeef250df188c78bfcb8c15d311ccc0b1384 | 109,704 | py | Python | COLORFUL-Python/colorful-server/tmp.py | FFFFOX/COLORFUL | 3a6fab6184f94b0a3a5b3e56a649cca076ddfc91 | [
"MIT"
] | 77 | 2021-12-09T03:14:31.000Z | 2022-03-06T06:06:38.000Z | COLORFUL-Python/colorful-server/tmp.py | FFFFOX/COLORFUL | 3a6fab6184f94b0a3a5b3e56a649cca076ddfc91 | [
"MIT"
] | 1 | 2021-12-09T03:22:23.000Z | 2021-12-09T03:22:23.000Z | COLORFUL-Python/colorful-server/tmp.py | FFFFOX/COLORFUL | 3a6fab6184f94b0a3a5b3e56a649cca076ddfc91 | [
"MIT"
] | 9 | 2021-12-09T07:02:41.000Z | 2021-12-17T07:51:04.000Z | import argparse
import os
import numpy as np
from PIL import Image
import cv2
from utils import Transforms, Utils
class Core:
@staticmethod
def simulate(input_path: str,
simulate_type: str = 'protanopia',
simulate_degree_primary: float = 1.0,
simulate_degr... | 39.906875 | 121 | 0.610917 |
9d4f848921ead22d8490505b08b41e8dac9f6f57 | 114 | py | Python | todo/tasks/admin.py | jiveshs98/Django-To-Do-App | bdc7858bbbacfd05b002eaf6b691085a97486f99 | [
"MIT"
] | null | null | null | todo/tasks/admin.py | jiveshs98/Django-To-Do-App | bdc7858bbbacfd05b002eaf6b691085a97486f99 | [
"MIT"
] | null | null | null | todo/tasks/admin.py | jiveshs98/Django-To-Do-App | bdc7858bbbacfd05b002eaf6b691085a97486f99 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(Task) | 22.8 | 33 | 0.763158 |
2eb4affe9551961c54620bed8cea78eedde1c786 | 17,277 | py | Python | where/pipelines/vlbi.py | ingridfausk/where | b65398911075b7ddef3a3a1146efa428eae498fe | [
"MIT"
] | 16 | 2018-08-31T10:31:11.000Z | 2022-03-15T16:07:24.000Z | where/pipelines/vlbi.py | ingridfausk/where | b65398911075b7ddef3a3a1146efa428eae498fe | [
"MIT"
] | 5 | 2018-07-13T14:04:24.000Z | 2021-06-17T02:14:44.000Z | where/pipelines/vlbi.py | ingridfausk/where | b65398911075b7ddef3a3a1146efa428eae498fe | [
"MIT"
] | 15 | 2018-06-07T05:45:24.000Z | 2022-03-15T16:07:27.000Z | """a VLBI pipeline
Description:
------------
"""
import itertools
# External library imports
import numpy as np
# Midgard imports
from midgard.dev import plugins
# Where imports
from where import apriori
from where import obs
from where import cleaners
from where import estimation
from where.lib import config
fro... | 36.220126 | 129 | 0.637148 |
5e8e946b5b8ff2e6f7f9d6e87c89fd3a62cdf644 | 4,353 | py | Python | contrib/seeds/generate-seeds.py | twairgroup/wondercoin | c075c2d0c1a4927d9f04d5100106e369a85128e5 | [
"MIT"
] | 1 | 2021-04-29T09:04:49.000Z | 2021-04-29T09:04:49.000Z | contrib/seeds/generate-seeds.py | twairgroup/wondercoin | c075c2d0c1a4927d9f04d5100106e369a85128e5 | [
"MIT"
] | 2 | 2021-06-08T21:50:46.000Z | 2021-06-09T14:04:30.000Z | contrib/seeds/generate-seeds.py | twairgroup/wondercoin | c075c2d0c1a4927d9f04d5100106e369a85128e5 | [
"MIT"
] | 1 | 2021-06-09T01:09:47.000Z | 2021-06-09T01:09:47.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.316547 | 98 | 0.580749 |
4b107a1b4ec3bb39336532d29b249679c3e6a658 | 716 | py | Python | pages/pred_helpers.py | richardOlson/nfl_plays_predictions | af337477f0cf1ee53dc1526575ef0f0ddb5c4848 | [
"MIT"
] | null | null | null | pages/pred_helpers.py | richardOlson/nfl_plays_predictions | af337477f0cf1ee53dc1526575ef0f0ddb5c4848 | [
"MIT"
] | null | null | null | pages/pred_helpers.py | richardOlson/nfl_plays_predictions | af337477f0cf1ee53dc1526575ef0f0ddb5c4848 | [
"MIT"
] | null | null | null | import dash_daq as daq
import dash_core_components as dcc
timeGroup = [
# Trying to make the quarter and the time grouped together
dcc.Dropdown(
options=[
{'label': 'First Quarter', 'value': 1},
{'label': 'Second Quarter', 'value': 2},
{'label': 'Third Quarter... | 24.689655 | 66 | 0.477654 |
fb0bbbc830550c0f0b0584ec226d894cfe5cb6c6 | 4,661 | py | Python | robotice_auth/backend.py | robotice/django-robotice-auth | 854605f2f37af9861851fff046794581fbdc93e6 | [
"Apache-2.0"
] | null | null | null | robotice_auth/backend.py | robotice/django-robotice-auth | 854605f2f37af9861851fff046794581fbdc93e6 | [
"Apache-2.0"
] | null | null | null | robotice_auth/backend.py | robotice/django-robotice-auth | 854605f2f37af9861851fff046794581fbdc93e6 | [
"Apache-2.0"
] | null | null | null |
""" Module defining the Django auth backend class for the Robotice API. """
import logging
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from roboticeclient import exceptions as robotice_exceptions
from robotice_auth import exceptions
from robotice_auth import user as aut... | 36.992063 | 79 | 0.611028 |
05d3617e5db86bdc2356e61fe61b23112fc07997 | 1,216 | py | Python | tests/pyre/components/component_instance_configuration_inheritance.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | tests/pyre/components/component_instance_configuration_inheritance.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | tests/pyre/components/component_instance_configuration_inheritance.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2018 all rights reserved
#
"""
Validate component configuration in the presence of inheritance
"""
def declare():
import pyre
# declare a component
class base(pyre.component, family="sample.base"):
"... | 22.109091 | 86 | 0.643914 |
47ce76acaa77fd0d3e0116446fa2f8394e3194ec | 6,827 | py | Python | pyclam/tests/test_graph.py | vishalbelsare/clam | 6dfa755bbc5ec2ff2c441a9fddc33e8317bc6e60 | [
"MIT"
] | 8 | 2020-07-20T20:57:06.000Z | 2022-03-15T14:00:26.000Z | pyclam/tests/test_graph.py | vishalbelsare/clam | 6dfa755bbc5ec2ff2c441a9fddc33e8317bc6e60 | [
"MIT"
] | 25 | 2020-01-30T00:47:34.000Z | 2022-01-25T06:23:50.000Z | pyclam/tests/test_graph.py | vishalbelsare/clam | 6dfa755bbc5ec2ff2c441a9fddc33e8317bc6e60 | [
"MIT"
] | 3 | 2020-07-20T20:49:29.000Z | 2022-01-24T08:04:01.000Z | import unittest
from itertools import combinations
from typing import Set, Dict, List
import numpy as np
from pyclam import datasets, criterion, Manifold, Graph, Cluster, Edge
class TestGraph(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
np.random.seed(42)
cls.data, _ = datas... | 41.126506 | 135 | 0.645232 |
e2dd5b73915c9cfcd45feef148f42151917973eb | 1,253 | py | Python | StatsUtils/plot.py | KOLANICH-libs/StatsUtils.py | eea58b175ed75ab6dc69506c9bae99eecb9d7ffc | [
"Unlicense"
] | null | null | null | StatsUtils/plot.py | KOLANICH-libs/StatsUtils.py | eea58b175ed75ab6dc69506c9bae99eecb9d7ffc | [
"Unlicense"
] | null | null | null | StatsUtils/plot.py | KOLANICH-libs/StatsUtils.py | eea58b175ed75ab6dc69506c9bae99eecb9d7ffc | [
"Unlicense"
] | null | null | null | import typing
import numpy as np
from .dists.MultivariateGaussian import MultivariateGaussian
from .utils import NumT, computeFunctionOnGrid, edges2Middles, edges2Widths
def plotPrecomputedHistogram(*, edges=None, freqs=None, middles=None, widths=None, **kwargs) -> None:
from matplotlib import pyplot as plt
if m... | 34.805556 | 198 | 0.734238 |
4719c9c6e467ee9a6d7c2f47acd7b3f275d3c517 | 1,819 | py | Python | test_ii.py | agongfogadofnasty/HolmesCompleteSeacrhEngine | 4f9d9b0eb6c96cf400527fd9cfd922d85ce362bc | [
"MIT"
] | null | null | null | test_ii.py | agongfogadofnasty/HolmesCompleteSeacrhEngine | 4f9d9b0eb6c96cf400527fd9cfd922d85ce362bc | [
"MIT"
] | 1 | 2020-12-20T06:06:55.000Z | 2020-12-20T06:06:55.000Z | test_ii.py | agongfogadofnasty/HolmesCompleteSeacrhEngine | 4f9d9b0eb6c96cf400527fd9cfd922d85ce362bc | [
"MIT"
] | 2 | 2020-12-08T15:34:17.000Z | 2021-01-05T06:02:12.000Z | # This file is used to test the built inverted index. To run the test, make sure that you've already generate the
# cache files.
import _pickle as pkl
import nltk
from nltk.tokenize import WordPunctTokenizer
from nltk.stem.wordnet import WordNetLemmatizer
from nltk.corpus import stopwords
from nltk.tag import pos_tag
... | 33.072727 | 207 | 0.742716 |
061703e07fb9364d61c43e8886104dbc37a80061 | 1,277 | py | Python | HashTable.py | ncorbuk/Python-Tutorial---Dictionaries-Hash-Table-Hash-Map-Code-Walk-through- | 021d9354f7ccf0ca4da2a5f6d83a8ef0763fbedf | [
"MIT"
] | 4 | 2019-01-22T03:56:09.000Z | 2020-06-16T02:52:02.000Z | HashTable.py | ncorbuk/Python-Tutorial---Dictionaries-Hash-Table-Hash-Map-Code-Walk-through- | 021d9354f7ccf0ca4da2a5f6d83a8ef0763fbedf | [
"MIT"
] | null | null | null | HashTable.py | ncorbuk/Python-Tutorial---Dictionaries-Hash-Table-Hash-Map-Code-Walk-through- | 021d9354f7ccf0ca4da2a5f6d83a8ef0763fbedf | [
"MIT"
] | 4 | 2019-04-17T09:50:00.000Z | 2020-04-05T15:24:45.000Z | class HashTable:
def __init__(self):
self.size = 256
self.hashmap = [[] for _ in range(0, self.size)]
# print(self.hashmap)
def hash_func(self, key):
hashed_key = hash(key) % self.size
return hashed_key
def set(self, key, value):
hash_key = self.hash_func(k... | 21.283333 | 56 | 0.523101 |
0041ea6d0b41b552d39f23bb42af22d80026c1a9 | 1,021 | py | Python | esphome/components/binary_sensor/rdm6300.py | psbaltar/esphome | a8d87a1fee5d9ec7bea81cd6e65d8ec7babfbde4 | [
"MIT"
] | 2 | 2020-05-11T09:26:16.000Z | 2021-07-20T03:06:37.000Z | esphome/components/binary_sensor/rdm6300.py | psbaltar/esphome | a8d87a1fee5d9ec7bea81cd6e65d8ec7babfbde4 | [
"MIT"
] | null | null | null | esphome/components/binary_sensor/rdm6300.py | psbaltar/esphome | a8d87a1fee5d9ec7bea81cd6e65d8ec7babfbde4 | [
"MIT"
] | null | null | null | import voluptuous as vol
from esphome.components import binary_sensor, rdm6300
import esphome.config_validation as cv
from esphome.const import CONF_NAME, CONF_UID
from esphome.cpp_generator import get_variable
DEPENDENCIES = ['rdm6300']
CONF_RDM6300_ID = 'rdm6300_id'
RDM6300BinarySensor = binary_sensor.binary_sens... | 32.935484 | 87 | 0.755142 |
5c980063bab1e47396320ef3cf89cf7aa37aef1c | 925 | py | Python | Interview Preparation Kit/Recursion: Davis' Staircase/entrega.py | pablosambuco/hackerrank | 223d6c848912c566efe7b59c02cf5c16081b968f | [
"MIT"
] | null | null | null | Interview Preparation Kit/Recursion: Davis' Staircase/entrega.py | pablosambuco/hackerrank | 223d6c848912c566efe7b59c02cf5c16081b968f | [
"MIT"
] | null | null | null | Interview Preparation Kit/Recursion: Davis' Staircase/entrega.py | pablosambuco/hackerrank | 223d6c848912c566efe7b59c02cf5c16081b968f | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the stepPerms function below.
def stepPerms(n,m=3):
tot=0
for x in rec(n,m):
n=1
i=0
l=0
while i<m:
if x[1] > 0:
l+=x[1]
n*=math.factorial(l)/(math.facto... | 18.137255 | 81 | 0.458378 |
d4805308161a53359cd82f086483733e92c1b0fc | 1,204 | py | Python | src/backend/socialapp/pipeline.py | shouyang/group-CMPUT404-project | a8d114b493ad2786c90e8b1f10c087fa4d5c81de | [
"MIT"
] | 2 | 2019-02-04T17:55:48.000Z | 2019-03-11T23:22:14.000Z | src/backend/socialapp/pipeline.py | shouyang/group-CMPUT404-project | a8d114b493ad2786c90e8b1f10c087fa4d5c81de | [
"MIT"
] | 7 | 2019-02-27T17:16:19.000Z | 2019-03-19T20:13:56.000Z | src/backend/socialapp/pipeline.py | shouyang/group-CMPUT404-project | a8d114b493ad2786c90e8b1f10c087fa4d5c81de | [
"MIT"
] | 2 | 2019-04-10T17:01:07.000Z | 2019-04-17T01:08:16.000Z | from .models import Author
from django.conf import settings
def save_profile(backend, user, response, *args, **kwargs):
# print(backend)
# print(response)
if backend.name == 'github':
if not Author.objects.filter(localuser=user):
try:
firstName = response["name"].split(... | 36.484848 | 88 | 0.429402 |
0ae24e0fa4c52c3e47a37ed6bfac1c3ff3ebcea6 | 168 | py | Python | generator/transpose.py | yuga-n/ModelLearner | 3193efd5eb15172ba8231a34829942040fcb0fc5 | [
"MIT"
] | null | null | null | generator/transpose.py | yuga-n/ModelLearner | 3193efd5eb15172ba8231a34829942040fcb0fc5 | [
"MIT"
] | null | null | null | generator/transpose.py | yuga-n/ModelLearner | 3193efd5eb15172ba8231a34829942040fcb0fc5 | [
"MIT"
] | 1 | 2021-09-14T14:52:28.000Z | 2021-09-14T14:52:28.000Z | import numpy as np
def transpose(batch):
return np.array([np.transpose(params) for params in batch])
def transpose_preprocess(x, y):
return transpose(x), y
| 16.8 | 63 | 0.714286 |
e469bd8c9cf7c0bc0584d785dfdd12a6c070f886 | 16,204 | py | Python | python/tvm/relay/transform/fake_quantization_to_integer.py | ashwinve/tvm | 32356c941436e102a72708ed2a028f4ef41c7d2d | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/transform/fake_quantization_to_integer.py | ashwinve/tvm | 32356c941436e102a72708ed2a028f4ef41c7d2d | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/transform/fake_quantization_to_integer.py | ashwinve/tvm | 32356c941436e102a72708ed2a028f4ef41c7d2d | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.023715 | 100 | 0.652 |
e54d18bce2130cb6d6e627dc9b864487c86c1bdc | 4,358 | py | Python | anim_script/GLSLJinja.py | demotomohiro/Reflection-Refraction-less-Ronpa-Raytracing-Renderer | bea6f497883a7741b638e52f986af6b2da4f3653 | [
"MIT"
] | 6 | 2018-03-21T07:39:21.000Z | 2020-11-26T11:11:17.000Z | anim_script/GLSLJinja.py | demotomohiro/Reflection-Refraction-less-Ronpa-Raytracing-Renderer | bea6f497883a7741b638e52f986af6b2da4f3653 | [
"MIT"
] | null | null | null | anim_script/GLSLJinja.py | demotomohiro/Reflection-Refraction-less-Ronpa-Raytracing-Renderer | bea6f497883a7741b638e52f986af6b2da4f3653 | [
"MIT"
] | 4 | 2017-01-26T13:54:25.000Z | 2018-10-30T23:02:56.000Z | from jinja2 import Environment, FunctionLoader, ChoiceLoader, FileSystemLoader
from itertools import chain
from collections import OrderedDict
class TemplateError(Exception):
def __init__(self, message):
self.message = message
class _TemplateFunc:
def __init__(self, *params):
self.id... | 33.782946 | 93 | 0.589261 |
949ef38312cd884c711f29aeea342be9003c851a | 5,922 | py | Python | gomaku/pytorch/GomakuNNetResidual.py | Veldrovive/alpha-zero-general | e00d48e2b7283a1070fa1d3d8ae7de3637a52cc0 | [
"MIT"
] | null | null | null | gomaku/pytorch/GomakuNNetResidual.py | Veldrovive/alpha-zero-general | e00d48e2b7283a1070fa1d3d8ae7de3637a52cc0 | [
"MIT"
] | null | null | null | gomaku/pytorch/GomakuNNetResidual.py | Veldrovive/alpha-zero-general | e00d48e2b7283a1070fa1d3d8ae7de3637a52cc0 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from ..GomakuGame import GomakuGame
from utils import dotdict
# args = dotdict({
# 'lr': 0.001,
# 'dropout': 0.3,
# 'epochs': 10,
# 'batch_size': 64,
# 'cuda': torch.cuda.is_available(),
# 'num_channels': 512,
# })
class Input... | 34.034483 | 99 | 0.568389 |
c7a23893acc607eea21943ff7d011f38572f8b3a | 1,518 | py | Python | vulture-whitelist.py | GhostofGoes/puresnmp | 878afc809014ea540aa2996a0a08bb4ef7044319 | [
"MIT"
] | null | null | null | vulture-whitelist.py | GhostofGoes/puresnmp | 878afc809014ea540aa2996a0a08bb4ef7044319 | [
"MIT"
] | null | null | null | vulture-whitelist.py | GhostofGoes/puresnmp | 878afc809014ea540aa2996a0a08bb4ef7044319 | [
"MIT"
] | null | null | null | import puresnmp.api.pythonic as py
import puresnmp.api.raw as raw
import puresnmp.exc as exc
import puresnmp.pdu as pdu
import puresnmp.priv as priv
import puresnmp.transport as tr
import puresnmp.types as types
import puresnmp.util as util
util.generate_engine_id_text
util.generate_engine_id_ip
util.generate_engine_i... | 18.740741 | 39 | 0.875494 |
80bc1ddd5e5ae783b066d2244c9993de4e44da8c | 13,435 | py | Python | src/lib/models/networks/resnet_spp_short.py | Aoxig/CenterNet-Fixed-For-Colab | 5edf76c2b569b499d21a5bb7f2608bb9ee0e260a | [
"MIT"
] | null | null | null | src/lib/models/networks/resnet_spp_short.py | Aoxig/CenterNet-Fixed-For-Colab | 5edf76c2b569b499d21a5bb7f2608bb9ee0e260a | [
"MIT"
] | null | null | null | src/lib/models/networks/resnet_spp_short.py | Aoxig/CenterNet-Fixed-For-Colab | 5edf76c2b569b499d21a5bb7f2608bb9ee0e260a | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
# Modified by Dequan Wang and Xingyi Zhou
# ------------------------------------------------------------------------------
from __f... | 35.078329 | 109 | 0.556606 |
f2960fe0cf13c4c86ae2bf2f5a34325e69617ff8 | 140 | py | Python | film/apps.py | elmaroufa/filmreview | d65e26c9ccb0cd882edce8fd54882f584fc0e338 | [
"MIT"
] | null | null | null | film/apps.py | elmaroufa/filmreview | d65e26c9ccb0cd882edce8fd54882f584fc0e338 | [
"MIT"
] | null | null | null | film/apps.py | elmaroufa/filmreview | d65e26c9ccb0cd882edce8fd54882f584fc0e338 | [
"MIT"
] | 1 | 2021-07-14T14:30:23.000Z | 2021-07-14T14:30:23.000Z | from django.apps import AppConfig
class FilmConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'film'
| 20 | 56 | 0.75 |
f88f4f3d380ae51417616fabb8590efc56ce71ce | 24,366 | py | Python | usedtools/MrMannequinsTools/MMT_Stash_Object.py | TheHoodieGuy02/blender-invasion | 9a4ca994cc9d7304b394a8ae79f5b380071a4f1d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | usedtools/MrMannequinsTools/MMT_Stash_Object.py | TheHoodieGuy02/blender-invasion | 9a4ca994cc9d7304b394a8ae79f5b380071a4f1d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | usedtools/MrMannequinsTools/MMT_Stash_Object.py | TheHoodieGuy02/blender-invasion | 9a4ca994cc9d7304b394a8ae79f5b380071a4f1d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | import bpy
import os
import importlib
from . import MMT_Stash_Material
#---------- NOTES -----------------------------------------------------------------------------
# This script is a work in progress! currently only works on meshes and does not consider object textures as references...
# Alrighty... so when we im... | 60.61194 | 270 | 0.623533 |
85412600912477b67fca52ef22611ad967acf7a4 | 1,660 | py | Python | openstack/network/v2/port_forwarding.py | tj8000rpm/openstacksdk | 161e49f60ae543bdd08e78b875295de51d2f25a3 | [
"Apache-2.0"
] | null | null | null | openstack/network/v2/port_forwarding.py | tj8000rpm/openstacksdk | 161e49f60ae543bdd08e78b875295de51d2f25a3 | [
"Apache-2.0"
] | null | null | null | openstack/network/v2/port_forwarding.py | tj8000rpm/openstacksdk | 161e49f60ae543bdd08e78b875295de51d2f25a3 | [
"Apache-2.0"
] | 1 | 2020-07-21T02:18:23.000Z | 2020-07-21T02:18:23.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 35.319149 | 75 | 0.73012 |
0ae2b3be79c3c4c3c802043bc468c358686d8fce | 672 | py | Python | Task1B.py | david-yd-hao/UK-Flood-Warning | 1022339858483bd3871d99f1d9c604d8f67ef3e5 | [
"MIT"
] | 1 | 2021-08-03T14:55:25.000Z | 2021-08-03T14:55:25.000Z | Task1B.py | cued-ia-computing/flood-fb530-yh463 | c214c88e6974f119d9cf38b3ac4352915e914c7c | [
"MIT"
] | null | null | null | Task1B.py | cued-ia-computing/flood-fb530-yh463 | c214c88e6974f119d9cf38b3ac4352915e914c7c | [
"MIT"
] | null | null | null | from floodsystem.stationdata import build_station_list
from floodsystem.geo import stations_by_distance
def run():
My_list = []
stations = build_station_list()
list_tuple = []
stations_2 = stations_by_distance(stations, (52.2053, 0.1218))
for station_tuple in stations_2:
list_t... | 29.217391 | 92 | 0.68006 |
3977226c35bda18f614cecd70e2200950ff24513 | 885 | py | Python | cloudtunes-server/cloudtunes/services/handlers.py | skymemoryGit/cloudtunes | 424bf59e05663b0df20e16ddbd119eb39f6a729b | [
"BSD-3-Clause"
] | 529 | 2015-01-01T04:59:12.000Z | 2022-03-31T16:09:38.000Z | cloudtunes-server/cloudtunes/services/handlers.py | skymemoryGit/cloudtunes | 424bf59e05663b0df20e16ddbd119eb39f6a729b | [
"BSD-3-Clause"
] | 21 | 2015-01-13T15:41:15.000Z | 2021-11-06T20:56:40.000Z | cloudtunes-server/cloudtunes/services/handlers.py | skymemoryGit/cloudtunes | 424bf59e05663b0df20e16ddbd119eb39f6a729b | [
"BSD-3-Clause"
] | 116 | 2015-01-04T22:12:56.000Z | 2022-02-23T11:43:01.000Z | from cloudtunes.base.handlers import ResourceHandler
class ServiceAuthHandler(ResourceHandler):
#noinspection PyMethodOverriding
def initialize(self, service_name, popup=False):
super(ServiceAuthHandler, self).initialize()
self.service_name = service_name
self._popup = popup
@pro... | 28.548387 | 57 | 0.628249 |
5b7024bf88e35d881663e6fa313e61f1b265a9d0 | 13,467 | py | Python | run/retrieval/selfattn/train.py | nashid/naturalcc | e9d9b4a296b61199fc35779b062db2205935a608 | [
"MIT"
] | 1 | 2021-12-21T05:52:37.000Z | 2021-12-21T05:52:37.000Z | run/retrieval/selfattn/train.py | hrshy0629/naturalcc | 9c3329dd8387c8242deb52bf590ebe3ac795f8de | [
"MIT"
] | null | null | null | run/retrieval/selfattn/train.py | hrshy0629/naturalcc | 9c3329dd8387c8242deb52bf590ebe3ac795f8de | [
"MIT"
] | null | null | null | import math
import os
import random
import torch
from ncc import LOGGER
from ncc import tasks
from ncc.data import iterators
from ncc.trainers.ncc_trainers import Trainer
from ncc.utils import checkpoint_utils, distributed_utils
from ncc.utils import set_seed
from ncc.utils import utils
from ncc.utils.file_ops.yaml_i... | 41.436923 | 117 | 0.662137 |
4dd019266cd9c960d9a5615c462cb3ba9d7c7aa7 | 3,852 | py | Python | venv/lib/python3.8/site-packages/pylint/checkers/async.py | DiegoSilvaHoffmann/Small-Ecommerce | c6f9d75cc6dd558aa1ba9abe0186a27fe15b32d2 | [
"MIT"
] | 463 | 2015-01-15T08:17:42.000Z | 2022-03-28T15:10:20.000Z | venv/lib/python3.8/site-packages/pylint/checkers/async.py | DiegoSilvaHoffmann/Small-Ecommerce | c6f9d75cc6dd558aa1ba9abe0186a27fe15b32d2 | [
"MIT"
] | 52 | 2015-01-06T02:43:59.000Z | 2022-03-14T11:15:21.000Z | env/lib/python3.9/site-packages/pylint/checkers/async.py | simotwo/AbileneParadox-ddd | c85961efb37aba43c0d99ed1c36d083507e2b2d3 | [
"MIT"
] | 249 | 2015-01-07T22:49:49.000Z | 2022-03-18T02:32:06.000Z | # Copyright (c) 2015-2018, 2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2017 Derek Gustafson <degustaf@gmail.com>
# Copyright (c) 2019, 2021 Pierre Sassoulas <pierre.sassoulas@gmail.com>
# Copyright (c) 2020 hippo91 <guillaume.peillex@gmail.com>
# Licensed under the GPL: https://www.gnu.org/licenses/old-l... | 40.547368 | 86 | 0.597612 |
79fa8308b0c450f9f695f3e0a8aa2c41cd1a1a58 | 5,028 | py | Python | extend_euserv/login_euserv.py | lw9726/extend-euserv | 0a40d2021630b7db4ab8b78390c2c42dc3809084 | [
"MIT"
] | 4 | 2021-08-18T16:10:56.000Z | 2021-11-07T08:47:26.000Z | extend_euserv/login_euserv.py | AMD-EPYC/extend-euserv | 02df0ef1d4c8f7017028963bfbba558e75c6658e | [
"MIT"
] | 2 | 2021-07-12T02:32:48.000Z | 2021-11-07T21:04:11.000Z | extend_euserv/login_euserv.py | AMD-EPYC/extend-euserv | 02df0ef1d4c8f7017028963bfbba558e75c6658e | [
"MIT"
] | 11 | 2021-05-19T11:52:05.000Z | 2022-03-08T11:42:05.000Z | """Login to https://support.euserv.com/."""
# pylint:
from typing import Optional
# import os
from time import sleep
from random import randint
import asyncio
# import dotenv
import pyppeteer
from logzero import logger
from extend_euserv.get_ppbrowser import get_ppbrowser, BROWSER
from extend_euserv.config import Se... | 32.649351 | 144 | 0.602625 |
cca7e2561fdde0ee36509eeb5c60d229edacbf92 | 319 | py | Python | setup.py | soushirou/StyleCLIP-pytorch | 4540e589da242e702b7cadfeb607dd6fa0b02ab5 | [
"MIT"
] | 26 | 2021-11-20T09:44:55.000Z | 2022-03-07T09:38:26.000Z | setup.py | soushirou/StyleCLIP-pytorch | 4540e589da242e702b7cadfeb607dd6fa0b02ab5 | [
"MIT"
] | 6 | 2021-11-15T12:40:34.000Z | 2022-03-16T12:24:40.000Z | setup.py | soushirou/StyleCLIP-pytorch | 4540e589da242e702b7cadfeb607dd6fa0b02ab5 | [
"MIT"
] | 3 | 2021-12-23T13:06:46.000Z | 2022-03-16T12:07:29.000Z | #!/usr/bin/env python
import os
from setuptools import setup
if __name__ == '__main__':
setup(
name='StyleCLIP-pytorch',
version=1.0,
description='PyTorch implementation of StyleCLIP global direction methods',
author='soushirou',
author_email='nampyo24@kaist.ac.kr',
)
| 22.785714 | 83 | 0.655172 |
89dc9a3b645eccfab5bbe827e1ea285f5bf55dbb | 1,191 | py | Python | geography/map.py | yesdeepakmittal/Business_Dashboard | 856c2aae727cb1fe82a1cf761f180b63c394fc09 | [
"MIT"
] | 2 | 2022-02-27T22:43:43.000Z | 2022-03-19T23:34:11.000Z | geography/map.py | yesdeepakmittal/Business_Dashboard | 856c2aae727cb1fe82a1cf761f180b63c394fc09 | [
"MIT"
] | null | null | null | geography/map.py | yesdeepakmittal/Business_Dashboard | 856c2aae727cb1fe82a1cf761f180b63c394fc09 | [
"MIT"
] | 1 | 2022-01-05T14:23:26.000Z | 2022-01-05T14:23:26.000Z | import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_html_components as html
import plotly.express as px
from data.datafile import geography
df = geography()
fig = px.scatter_mapbox(
df,
title='Customer Location',
lat="Latitude",
lon="Longitude",
... | 30.538462 | 104 | 0.594458 |
542ddeb8910bcb1e05c48b1fd6f4a4f9c0946f12 | 5,099 | py | Python | tests/test_notebooks.py | ruiwang1994/interpret-community | 21c343b8743ebab9f3c5628a1b0e991c9437af51 | [
"MIT"
] | 1 | 2022-03-07T10:32:54.000Z | 2022-03-07T10:32:54.000Z | tests/test_notebooks.py | ruiwang1994/interpret-community | 21c343b8743ebab9f3c5628a1b0e991c9437af51 | [
"MIT"
] | null | null | null | tests/test_notebooks.py | ruiwang1994/interpret-community | 21c343b8743ebab9f3c5628a1b0e991c9437af51 | [
"MIT"
] | null | null | null | import nbformat as nbf
import papermill as pm
import pytest
import scrapbook as sb
SORTED_LOCAL_IMPORTANCE_NAMES = 'sorted_local_importance_names'
def append_scrapbook_commands(input_nb_path, output_nb_path, scrap_specs):
notebook = nbf.read(input_nb_path, as_version=4)
notebook = nbf.v4.upgrade(notebook, fr... | 43.581197 | 87 | 0.805256 |
61ab41bcefe19f127a9df1f6e860314c8745612e | 2,813 | py | Python | src/panaedra/msroot/msutil/logic/sc_mspysys.py | Panaedra/panaedra_py_platform_base | 3662c9d598e92870b0d409035336b94e6c195920 | [
"MIT"
] | 1 | 2017-11-10T07:12:18.000Z | 2017-11-10T07:12:18.000Z | src/panaedra/msroot/msutil/logic/sc_mspysys.py | Panaedra/panaedra_py_platform_base | 3662c9d598e92870b0d409035336b94e6c195920 | [
"MIT"
] | null | null | null | src/panaedra/msroot/msutil/logic/sc_mspysys.py | Panaedra/panaedra_py_platform_base | 3662c9d598e92870b0d409035336b94e6c195920 | [
"MIT"
] | null | null | null | import gc
import sys
import inspect
import threading
class sc_mspysys(object):
@classmethod
def MicroSleep(cls, cMillisecondsIP):
'''Called by bridge. Does the same as time.sleep(), but enables responding to signals like kill -2 (SIGINT) '''
iMillisecondsIP = int(cMillisecondsIP)
dummy_ev... | 30.576087 | 179 | 0.553857 |
519a576bb181e7e3150bc72d9e22f749db203e8b | 5,891 | py | Python | experiments/tuned_learners.py | arennax/contemporary2020 | 1da86d384a5b7e1afea0d3e309799728a0734e9f | [
"Unlicense"
] | null | null | null | experiments/tuned_learners.py | arennax/contemporary2020 | 1da86d384a5b7e1afea0d3e309799728a0734e9f | [
"Unlicense"
] | null | null | null | experiments/tuned_learners.py | arennax/contemporary2020 | 1da86d384a5b7e1afea0d3e309799728a0734e9f | [
"Unlicense"
] | 1 | 2021-06-14T23:56:11.000Z | 2021-06-14T23:56:11.000Z | from experiments.utils import KFold_df, normalize, mre_calc, sa_calc
from sklearn.tree import DecisionTreeRegressor
from experiments.optimizers import *
# def CART_DE(dataset, methods):
# dataset = normalize(dataset)
# mre_list = []
# sa_list = []
# rse_list = []
# for train, test in KFold_df(da... | 35.70303 | 102 | 0.621456 |
80b7c784b353bebafe754747f1f09480b73b2faa | 2,819 | py | Python | src/utils/utils.py | ds-wook/jobcare-recommendation | 5abb09901e504304a5cd9793da26f5328ba186a1 | [
"Apache-2.0"
] | 7 | 2022-01-28T16:19:15.000Z | 2022-02-16T09:02:57.000Z | src/utils/utils.py | ds-wook/jobcare-recommendation | 5abb09901e504304a5cd9793da26f5328ba186a1 | [
"Apache-2.0"
] | null | null | null | src/utils/utils.py | ds-wook/jobcare-recommendation | 5abb09901e504304a5cd9793da26f5328ba186a1 | [
"Apache-2.0"
] | null | null | null | import logging
import logging.handlers
import os
import random
import time
from contextlib import contextmanager
from typing import Any, Tuple, Union
import numpy as np
from numpy.typing import ArrayLike
from pandas import DataFrame
from sklearn.metrics import f1_score
def seed_everything(seed: int = 42) -> None:
... | 32.77907 | 87 | 0.562966 |
7e82156b2271f319a605eba574c2800f29e5e950 | 539 | py | Python | test_framework/page_object/ChecksPageObject.py | drewkarpov/python_pytest | bb94ca52212cf06c5a7c4b99dc6d07db865169e6 | [
"BSD-3-Clause"
] | null | null | null | test_framework/page_object/ChecksPageObject.py | drewkarpov/python_pytest | bb94ca52212cf06c5a7c4b99dc6d07db865169e6 | [
"BSD-3-Clause"
] | 4 | 2021-03-30T14:08:07.000Z | 2021-06-10T20:00:17.000Z | test_framework/page_object/ChecksPageObject.py | drewkarpov/python_pytest | bb94ca52212cf06c5a7c4b99dc6d07db865169e6 | [
"BSD-3-Clause"
] | null | null | null | from selenium.webdriver.common.by import By
from test_framework.helpers.BrowserApi import BrowserApi
class ChecksPageSelector:
CHECKS_ROW = (By.XPATH, "//*[@class='checks-row']")
EMAIL_TAB = (By.ID, "base-url")
class ChecksPageObject(BrowserApi):
def __init__(self, driver):
super().__init__(dri... | 26.95 | 69 | 0.736549 |
77b4e3ed291a020a19638aebfbae7e348472d540 | 2,130 | py | Python | tests/daemon/test_daemon.py | vittyvk/WALinuxAgent | 4364b87cb610c6bd8ddd4fc87023ec76bb6c44b7 | [
"Apache-2.0"
] | null | null | null | tests/daemon/test_daemon.py | vittyvk/WALinuxAgent | 4364b87cb610c6bd8ddd4fc87023ec76bb6c44b7 | [
"Apache-2.0"
] | null | null | null | tests/daemon/test_daemon.py | vittyvk/WALinuxAgent | 4364b87cb610c6bd8ddd4fc87023ec76bb6c44b7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 32.272727 | 76 | 0.707512 |
382efe8d40a01d30a0782b8ba1ba02180afea782 | 3,836 | py | Python | imperative/python/test/unit/core/test_serialization.py | gedoensmax/MegEngine | dfb9d9801bd101970024e50865ec99a0048f53d7 | [
"Apache-2.0"
] | 5,168 | 2020-03-19T06:10:04.000Z | 2022-03-31T11:11:54.000Z | imperative/python/test/unit/core/test_serialization.py | gedoensmax/MegEngine | dfb9d9801bd101970024e50865ec99a0048f53d7 | [
"Apache-2.0"
] | 286 | 2020-03-25T01:36:23.000Z | 2022-03-31T10:26:33.000Z | imperative/python/test/unit/core/test_serialization.py | gedoensmax/MegEngine | dfb9d9801bd101970024e50865ec99a0048f53d7 | [
"Apache-2.0"
] | 515 | 2020-03-19T06:10:05.000Z | 2022-03-30T09:15:59.000Z | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | 33.946903 | 88 | 0.62122 |
c566109b623f7b64c72777324c703d23fe729c1f | 1,910 | py | Python | app/main/models.py | HenriqueLR/hangman-game | 6cb29ae1ab666af0d6b054b2e1d598ebb5ff8db3 | [
"MIT"
] | null | null | null | app/main/models.py | HenriqueLR/hangman-game | 6cb29ae1ab666af0d6b054b2e1d598ebb5ff8db3 | [
"MIT"
] | 18 | 2017-10-28T23:26:17.000Z | 2017-11-24T20:45:45.000Z | app/main/models.py | HenriqueLR/hangman-game | 6cb29ae1ab666af0d6b054b2e1d598ebb5ff8db3 | [
"MIT"
] | null | null | null | #coding: utf-8
from django.db import models, transaction
from django.db.models.signals import post_save
from django.db.utils import IntegrityError
from django.dispatch import receiver
from main.utils import remove_special_word, parse_csv_file
from main.validators import ContentTypeRestrictedFileField
from conf.setting... | 28.507463 | 104 | 0.757068 |
355214c50f29b403fba621d28c5c374e5940ca18 | 1,027 | py | Python | sys/urllib_demo.py | gottaegbert/penter | 8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d | [
"MIT"
] | 13 | 2020-01-04T07:37:38.000Z | 2021-08-31T05:19:58.000Z | sys/urllib_demo.py | gottaegbert/penter | 8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d | [
"MIT"
] | 3 | 2020-06-05T22:42:53.000Z | 2020-08-24T07:18:54.000Z | sys/urllib_demo.py | gottaegbert/penter | 8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d | [
"MIT"
] | 9 | 2020-10-19T04:53:06.000Z | 2021-08-31T05:20:01.000Z | from urllib.request import urlopen
for line in urlopen('https://www.baidu.com/'):
line = line.decode('utf-8') # Decoding the binary data to text.
if 'body' in line or 'baidu' in line: # look for Eastern Time
print(line)
#处理get请求,不传data,则为get请求
from urllib.request import urlopen
from urllib.parse im... | 31.121212 | 71 | 0.770204 |
0d439fcd7bd0186a69994f6e37616300bb811405 | 9,756 | py | Python | setup.py | ljjsalt/taichi | 97b782606b769896493330ad04c03a74b050ecf5 | [
"MIT"
] | 1 | 2021-07-12T03:48:15.000Z | 2021-07-12T03:48:15.000Z | setup.py | ljjsalt/taichi | 97b782606b769896493330ad04c03a74b050ecf5 | [
"MIT"
] | null | null | null | setup.py | ljjsalt/taichi | 97b782606b769896493330ad04c03a74b050ecf5 | [
"MIT"
] | null | null | null | # Optional environment variables supported by setup.py:
# DEBUG
# build the C++ taichi_core extension with debug symbols.
#
# TAICHI_CMAKE_ARGS
# extra cmake args for C++ taichi_core extension.
import glob
import multiprocessing
import os
import platform
import shutil
import subprocess
import sys
from dist... | 35.347826 | 79 | 0.617056 |
7f8aa977396fab2943cb43bd6f4b0096160ce2ab | 609 | py | Python | mtx.py | LCB0B/metric | 0686ce80326b60ddde77989b82c218d94a016cd2 | [
"MIT"
] | null | null | null | mtx.py | LCB0B/metric | 0686ce80326b60ddde77989b82c218d94a016cd2 | [
"MIT"
] | null | null | null | mtx.py | LCB0B/metric | 0686ce80326b60ddde77989b82c218d94a016cd2 | [
"MIT"
] | null | null | null | from scipy.io import mmread
import numpy as np
A = mmread('./3elt_dual/3elt_dual.mtx')
b = mmread('./3elt_dual/3elt_dual_coord.mtx')
def distance_matrix_2(x, y):
return (((x-y)**2).sum())**0.5
np.random.shuffle(b)
relation = np.array([ [distance_matrix_2(x, y) for x in b ] for y in b])
np.savetxt("3elt_dual/rela... | 33.833333 | 88 | 0.701149 |
1bb5581de214b0802f43889fe90e4872f114a31a | 6,796 | py | Python | venv/lib/python2.7/site-packages/sqlalchemy/log.py | banianlabs/Stash-Prototype | 6a90817b7dd2e8eb6abf8fa0ac1c60ac09aa7936 | [
"MIT"
] | 5 | 2015-01-18T01:47:56.000Z | 2016-01-30T14:58:58.000Z | venv/lib/python2.7/site-packages/sqlalchemy/log.py | banianlabs/Stash-Prototype | 6a90817b7dd2e8eb6abf8fa0ac1c60ac09aa7936 | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/sqlalchemy/log.py | banianlabs/Stash-Prototype | 6a90817b7dd2e8eb6abf8fa0ac1c60ac09aa7936 | [
"MIT"
] | 1 | 2015-02-09T22:15:14.000Z | 2015-02-09T22:15:14.000Z | # sqlalchemy/log.py
# Copyright (C) 2006-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
# Includes alterations by Vinay Sajip vinay_sajip@yahoo.co.uk
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Logging control and... | 31.031963 | 84 | 0.654503 |
186a8dd1c735e735f62174b02c0464006cc68cf2 | 3,624 | py | Python | wildlifecompliance/settings.py | sharpeez/ledger | 0ea05669f488336a63e2bdd6390725d00d619e9a | [
"Apache-2.0"
] | null | null | null | wildlifecompliance/settings.py | sharpeez/ledger | 0ea05669f488336a63e2bdd6390725d00d619e9a | [
"Apache-2.0"
] | null | null | null | wildlifecompliance/settings.py | sharpeez/ledger | 0ea05669f488336a63e2bdd6390725d00d619e9a | [
"Apache-2.0"
] | null | null | null | from django.core.exceptions import ImproperlyConfigured
from ledger.settings_base import *
ROOT_URLCONF = 'wildlifecompliance.urls'
SITE_ID = 1
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles_wc')
INSTALLED_APPS += [
'bootstrap3',
'wildlifecompliance',
'wildlifecompliance.components.main',
'wildlif... | 37.360825 | 115 | 0.716611 |
e3c232dcc1145d3d6518e38758629a4924d4c05c | 1,833 | py | Python | vespa/analysis/fileio/philips_fidsum.py | vespa-mrs/vespa | 6d3e84a206ec427ac1304e70c7fadf817432956b | [
"BSD-3-Clause"
] | null | null | null | vespa/analysis/fileio/philips_fidsum.py | vespa-mrs/vespa | 6d3e84a206ec427ac1304e70c7fadf817432956b | [
"BSD-3-Clause"
] | 4 | 2021-04-17T13:58:31.000Z | 2022-01-20T14:19:57.000Z | vespa/analysis/fileio/philips_fidsum.py | vespa-mrs/vespa | 6d3e84a206ec427ac1304e70c7fadf817432956b | [
"BSD-3-Clause"
] | 3 | 2021-06-05T16:34:57.000Z | 2022-01-19T16:13:22.000Z | """
Routines for reading a Philips .spar/.sdat formats and returning an
DataRawFidsum object populated with the file's data.
"""
# Python modules
import os.path
# 3rd party modules
import numpy as np
# Our modules
import vespa.analysis.fileio.raw_reader as raw_reader
import vespa.analysis.fileio.util_exceptions as... | 29.564516 | 99 | 0.639935 |
c6a7d474d06e6ba0c427024e82b0c4b33dd1c575 | 11,729 | py | Python | deuceclient/client/deuce.py | TheSriram/deuce-client | 87efbbd912fd603bc70a5fea199ba26f75d34235 | [
"Apache-2.0"
] | null | null | null | deuceclient/client/deuce.py | TheSriram/deuce-client | 87efbbd912fd603bc70a5fea199ba26f75d34235 | [
"Apache-2.0"
] | null | null | null | deuceclient/client/deuce.py | TheSriram/deuce-client | 87efbbd912fd603bc70a5fea199ba26f75d34235 | [
"Apache-2.0"
] | null | null | null | """
Deuce API
"""
from __future__ import print_function
import json
import requests
import logging
class DeuceVault(Command):
"""
Deuce Vault Functionality
"""
def __init__(self, sslenabled, authenticator, apihost):
"""
Initialize the Deuce Client access
sslenabled - True ... | 35.435045 | 79 | 0.543184 |
61ee5125afc203dabb237194b4fd646fae3b2f95 | 12,461 | py | Python | lib/concurrence/database/mysql/client.py | toymachine/concurrence | 02f14e90e5f591970f87828c4a6e8f985d67834f | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2015-11-05T06:06:33.000Z | 2015-11-05T06:06:33.000Z | lib/concurrence/database/mysql/client.py | toymachine/concurrence | 02f14e90e5f591970f87828c4a6e8f985d67834f | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | lib/concurrence/database/mysql/client.py | toymachine/concurrence | 02f14e90e5f591970f87828c4a6e8f985d67834f | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2009, Hyves (Startphone Ltd.)
#
# This module is part of the Concurrence Framework and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
#TODO supporting closing a halfread resultset (e.g. automatically read and discard rest)
from concurrence import TimeoutErr... | 37.197015 | 123 | 0.627157 |
1ae64d9f547e1987fd7bf520387c894aa2238ee2 | 546 | py | Python | crawler/spiders/crawler.py | omeraslandogdu/scrapy-wsgi | d3ef32f69c8e1b7f6c6e894c315612bc4920ccaf | [
"Apache-2.0"
] | null | null | null | crawler/spiders/crawler.py | omeraslandogdu/scrapy-wsgi | d3ef32f69c8e1b7f6c6e894c315612bc4920ccaf | [
"Apache-2.0"
] | null | null | null | crawler/spiders/crawler.py | omeraslandogdu/scrapy-wsgi | d3ef32f69c8e1b7f6c6e894c315612bc4920ccaf | [
"Apache-2.0"
] | null | null | null | import scrapy
import js2py
from scrapy import Selector, Request
import sys
import importlib
importlib.reload(sys)
class CrawlerSpider(scrapy.Spider):
name = 'crawler'
def __init__(self, urls=None, items={},**kwargs):
super(CrawlerSpider, self).__init__(**kwargs)
self.start_urls = urls.split("... | 22.75 | 67 | 0.68315 |
9604b94feca656787adfc1fb0c7c605393893262 | 60,615 | py | Python | keras/backend/cntk_backend.py | smistad/keras | 1b1e09a3665d71061bb5b62ca475d304634a85bf | [
"MIT"
] | null | null | null | keras/backend/cntk_backend.py | smistad/keras | 1b1e09a3665d71061bb5b62ca475d304634a85bf | [
"MIT"
] | null | null | null | keras/backend/cntk_backend.py | smistad/keras | 1b1e09a3665d71061bb5b62ca475d304634a85bf | [
"MIT"
] | null | null | null | from __future__ import print_function
import cntk as C
import numpy as np
from .common import _FLOATX, _EPSILON, image_dim_ordering, image_data_format
from collections import defaultdict
from contextlib import contextmanager
import warnings
C.set_global_option('align_axis', 1)
b_any = any
dev = C.device.use_defau... | 29.49635 | 96 | 0.58469 |
db110b39bfc2d285be6a21e0f8cba1c5cc7e6ef0 | 17,128 | py | Python | testscripts/RDKB/component/EthWAN/TS_ETHWAN_GetMACsecRequiredEnableOnFactoryReset.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/EthWAN/TS_ETHWAN_GetMACsecRequiredEnableOnFactoryReset.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/EthWAN/TS_ETHWAN_GetMACsecRequiredEnableOnFactoryReset.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | ##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2020 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... | 53.69279 | 150 | 0.616534 |
3e6f12a96ae9a361b062b1a6263dcd769f44c0b3 | 4,398 | py | Python | modules/spider/spider/middlewares.py | Ladder-Climbers/mayne-code | d355cc56013db4ac2db50fddde3e9d203d965ab6 | [
"MIT"
] | null | null | null | modules/spider/spider/middlewares.py | Ladder-Climbers/mayne-code | d355cc56013db4ac2db50fddde3e9d203d965ab6 | [
"MIT"
] | null | null | null | modules/spider/spider/middlewares.py | Ladder-Climbers/mayne-code | d355cc56013db4ac2db50fddde3e9d203d965ab6 | [
"MIT"
] | null | null | null | # Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
from scrapy.downloadermiddlewares.useragent import UserAgentMiddleware
from fake_useragent import UserAgent
import random
# useful for handling dif... | 34.093023 | 78 | 0.680309 |
6193f5e615eb37333f8853d1d1410b07529706de | 4,404 | py | Python | Validation/RecoTau/python/dataTypes/ValidateTausOnRealData_cff.py | jolim97/cmssw | 5bbca6aa49462c08ef9e5e61f9dc628d9f142466 | [
"Apache-2.0"
] | null | null | null | Validation/RecoTau/python/dataTypes/ValidateTausOnRealData_cff.py | jolim97/cmssw | 5bbca6aa49462c08ef9e5e61f9dc628d9f142466 | [
"Apache-2.0"
] | null | null | null | Validation/RecoTau/python/dataTypes/ValidateTausOnRealData_cff.py | jolim97/cmssw | 5bbca6aa49462c08ef9e5e61f9dc628d9f142466 | [
"Apache-2.0"
] | 2 | 2020-03-20T18:46:13.000Z | 2021-03-12T09:23:07.000Z | import FWCore.ParameterSet.Config as cms
from Validation.RecoTau.RecoTauValidation_cfi import *
import copy
from RecoJets.Configuration.RecoPFJets_cff import *
import PhysicsTools.PatAlgos.tools.helpers as helpers
kinematicSelectedPFJets = cms.EDFilter(
"TauValPFJetSelector",
src = cms.InputTag('ak4PFJets'),
... | 48.395604 | 277 | 0.743869 |
6bfe907f09ad17abf5d455add2a69bfe84d77b3b | 539 | py | Python | tests/unit/test_endpoints.py | Luoyufu/penguinSDK | 0046a03027d33612b4e3abbcc188e684aa02e120 | [
"MIT"
] | 5 | 2018-03-12T07:13:20.000Z | 2020-05-10T22:22:03.000Z | tests/unit/test_endpoints.py | Luoyufu/penguinSDK | 0046a03027d33612b4e3abbcc188e684aa02e120 | [
"MIT"
] | 6 | 2019-10-18T15:42:32.000Z | 2021-06-01T21:34:25.000Z | tests/unit/test_endpoints.py | Luoyufu/penguinSDK | 0046a03027d33612b4e3abbcc188e684aa02e120 | [
"MIT"
] | 4 | 2018-06-19T06:20:44.000Z | 2021-01-28T09:23:04.000Z | # -*- coding: utf-8 -*-
from penguinsdk.endpoints import Endpoints, get_url
def test_endpoints():
endpoints = Endpoints(
'base_uri',
endpoint1='/endpoint1',
endpoint2='/endpoint2')
assert endpoints.get_url('endpoint1') == 'base_uri/endpoint1'
def test_get_auth_url():
... | 25.666667 | 97 | 0.653061 |
0c8719164949adc7051ce13da70e914a4f5e38c8 | 3,102 | py | Python | tests/providers/google/cloud/operators/test_postgres_to_gcs_system.py | maciekgawron/airflow | ccb2899e5bf859a363dc86af7e2ca63c0c4eef66 | [
"Apache-2.0"
] | 1 | 2020-02-24T00:17:26.000Z | 2020-02-24T00:17:26.000Z | tests/providers/google/cloud/operators/test_postgres_to_gcs_system.py | HubBucket-Team/airflow | dcf87435219307d4e916a8abc2b819ad75e2b1cf | [
"Apache-2.0"
] | null | null | null | tests/providers/google/cloud/operators/test_postgres_to_gcs_system.py | HubBucket-Team/airflow | dcf87435219307d4e916a8abc2b819ad75e2b1cf | [
"Apache-2.0"
] | 1 | 2020-02-24T00:17:29.000Z | 2020-02-24T00:17:29.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 29.826923 | 84 | 0.693424 |
d57f50a6935889c954bd495a9fb166526f52786e | 3,766 | py | Python | tensorflow/python/keras/distribute/keras_premade_models_test.py | leike666666/tensorflow | a3fd0ddfcb716be124e95b51e96e6c1e4507ef64 | [
"Apache-2.0"
] | 12 | 2020-12-28T18:42:10.000Z | 2022-03-24T17:34:21.000Z | tensorflow/python/keras/distribute/keras_premade_models_test.py | sagol/tensorflow | 04f2870814d2773e09dcfa00cbe76a66a2c4de88 | [
"Apache-2.0"
] | 2 | 2021-08-25T15:58:11.000Z | 2022-02-10T01:47:24.000Z | tensorflow/python/keras/distribute/keras_premade_models_test.py | sagol/tensorflow | 04f2870814d2773e09dcfa00cbe76a66a2c4de88 | [
"Apache-2.0"
] | 3 | 2020-03-09T19:17:02.000Z | 2020-06-26T23:14:31.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.824742 | 80 | 0.728359 |
0bb18a3696ae591626f70c210cdd232cccfb08f8 | 4,558 | py | Python | tools/check_radar_nc.py | mgaggero/tdm-tools | 525dc643c2fe90e29c6cdde6568174ab396893b6 | [
"Apache-2.0"
] | null | null | null | tools/check_radar_nc.py | mgaggero/tdm-tools | 525dc643c2fe90e29c6cdde6568174ab396893b6 | [
"Apache-2.0"
] | 5 | 2018-11-28T11:02:58.000Z | 2019-02-07T09:55:26.000Z | tools/check_radar_nc.py | mgaggero/tdm-tools | 525dc643c2fe90e29c6cdde6568174ab396893b6 | [
"Apache-2.0"
] | 5 | 2018-10-23T08:07:53.000Z | 2019-08-07T07:08:20.000Z | # Copyright 2018-2019 CRS4
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | 35.609375 | 79 | 0.654015 |
a4ae699fbd5301f5e8d7e3c2ff4127db3c6a1288 | 3,007 | py | Python | tests/integration.py | ScriptBox99/azure-counterfit | 757a51e082f47d446cf9cc0c93011c3a4953be52 | [
"MIT"
] | 495 | 2021-05-03T17:11:52.000Z | 2022-03-31T19:22:40.000Z | tests/integration.py | ScriptBox99/azure-counterfit | 757a51e082f47d446cf9cc0c93011c3a4953be52 | [
"MIT"
] | 25 | 2021-05-06T00:07:19.000Z | 2022-03-31T12:16:25.000Z | tests/integration.py | ScriptBox99/azure-counterfit | 757a51e082f47d446cf9cc0c93011c3a4953be52 | [
"MIT"
] | 79 | 2021-05-03T21:31:44.000Z | 2022-03-13T14:42:08.000Z | from rich.table import Table
import argparse
import json
import sys
from counterfit.core.state import CFState
from counterfit.core.output import CFPrint
from counterfit.core.utils import set_id
from counterfit.core.attacks import CFAttack
from counterfit.CFPrint.logger import AttackLogger
def run_test(framework, targ... | 30.373737 | 89 | 0.546724 |
e0b04133274baa9c454ba0c51edb4e6bd093ea19 | 40,424 | py | Python | quadtree/core.py | markriedl/gaige | e4984571ae368195b6bc296e69ed707a86b88da3 | [
"MIT"
] | 100 | 2018-11-26T17:04:50.000Z | 2022-03-26T10:16:23.000Z | quadtree/core.py | markriedl/gaige | e4984571ae368195b6bc296e69ed707a86b88da3 | [
"MIT"
] | null | null | null | quadtree/core.py | markriedl/gaige | e4984571ae368195b6bc296e69ed707a86b88da3 | [
"MIT"
] | 9 | 2018-12-12T01:10:41.000Z | 2020-07-04T18:20:04.000Z | '''
* Copyright (c) 2014, 2015 Entertainment Intelligence Lab, Georgia Institute of Technology.
* Originally developed by Mark Riedl.
* Last edited by Mark Riedl 05/2015
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*... | 30.099777 | 218 | 0.653572 |
0a63e925f82ab48fd48a71d0c1dabb14d5b0f4f8 | 3,785 | py | Python | cute_bringup/script/cute_basic_api.py | ZhangShanxiu/catkin_ws | 5bb13e990fea5df1b385e9c2092090919e1400a7 | [
"BSD-3-Clause"
] | null | null | null | cute_bringup/script/cute_basic_api.py | ZhangShanxiu/catkin_ws | 5bb13e990fea5df1b385e9c2092090919e1400a7 | [
"BSD-3-Clause"
] | null | null | null | cute_bringup/script/cute_basic_api.py | ZhangShanxiu/catkin_ws | 5bb13e990fea5df1b385e9c2092090919e1400a7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 28 09:48:30 2017
@author: Cong Liu
Software License Agreement (BSD License)
Copyright (c) 2017, Han's Robot Co., Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provide... | 40.698925 | 95 | 0.705945 |
37fcb266f71f11d530191c65434106cb60431eaf | 382 | py | Python | lab2/divisortest.py | VanLunis/tsbb15 | f609bc1a5ccf49378d63e8181a9d415a884948f9 | [
"MIT"
] | null | null | null | lab2/divisortest.py | VanLunis/tsbb15 | f609bc1a5ccf49378d63e8181a9d415a884948f9 | [
"MIT"
] | null | null | null | lab2/divisortest.py | VanLunis/tsbb15 | f609bc1a5ccf49378d63e8181a9d415a884948f9 | [
"MIT"
] | null | null | null | import numpy as np
import scipy
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from cvl_labs.lab1 import load_lab_image, get_cameraman
from scipy.ndimage.interpolation import shift as intepShift
test = np.divide([18, 16, 20], [3, 2, 5])
print(test)
testmult = np.multiply([2,2,2],[2,3,4])
print(testm... | 22.470588 | 59 | 0.746073 |
2bedfe0adb3561578836a19f7a119faafb23dcf8 | 8,353 | py | Python | jina/parsers/__init__.py | rajathpatel23/jina | 1e54f679a39a0e0bea2e65781d200f1042a627fd | [
"Apache-2.0"
] | 2 | 2021-11-01T09:52:45.000Z | 2022-01-11T09:49:48.000Z | jina/parsers/__init__.py | Lihsrah/jina | f298f3370dcffea363f5b75ec9250210c545c415 | [
"Apache-2.0"
] | null | null | null | jina/parsers/__init__.py | Lihsrah/jina | f298f3370dcffea363f5b75ec9250210c545c415 | [
"Apache-2.0"
] | 1 | 2021-07-02T03:10:47.000Z | 2021-07-02T03:10:47.000Z | import argparse
from jina.parsers.client import mixin_comm_protocol_parser
from .helper import _SHOW_ALL_ARGS
def set_pea_parser(parser=None):
"""Set the parser for the Pea
:param parser: an optional existing parser to build upon
:return: the parser
"""
if not parser:
from .base import s... | 28.124579 | 105 | 0.654855 |
9a9526665af2d318e00b3088a37504f8ec8474ce | 4,516 | py | Python | ICOAADS_Wood/io_utils/EcoFOCI_db_io.py | shaunwbell/FOCI_Analysis | dde4a5f0badd76fe5719575d5c138813ab156b70 | [
"MIT"
] | null | null | null | ICOAADS_Wood/io_utils/EcoFOCI_db_io.py | shaunwbell/FOCI_Analysis | dde4a5f0badd76fe5719575d5c138813ab156b70 | [
"MIT"
] | null | null | null | ICOAADS_Wood/io_utils/EcoFOCI_db_io.py | shaunwbell/FOCI_Analysis | dde4a5f0badd76fe5719575d5c138813ab156b70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Background:
--------
EcoFOCI_db_io.py
Purpose:
--------
Various Routines and Classes to interface with the mysql database that houses EcoFOCI meta data
History:
--------
2017-07-28 S.Bell - replace pymsyql with mysql.connector -> provides purepython connection and prepared stat... | 29.324675 | 115 | 0.589903 |
0ae9eab238bebfc43ae5a543e0370e6605dd81f0 | 14,295 | py | Python | orcid_api_v3/models/qualification_summary_v30_rc1.py | tenet-ac-za/NZ-ORCID-Hub | f1183fbb94509b102fa58d7812ed33d8f35c5d4d | [
"MIT"
] | 15 | 2017-02-06T01:41:57.000Z | 2021-07-22T08:53:40.000Z | orcid_api_v3/models/qualification_summary_v30_rc1.py | tenet-ac-za/NZ-ORCID-Hub | f1183fbb94509b102fa58d7812ed33d8f35c5d4d | [
"MIT"
] | 82 | 2017-03-23T00:30:04.000Z | 2022-02-01T00:10:34.000Z | orcid_api_v3/models/qualification_summary_v30_rc1.py | tenet-ac-za/NZ-ORCID-Hub | f1183fbb94509b102fa58d7812ed33d8f35c5d4d | [
"MIT"
] | 6 | 2017-03-23T07:26:05.000Z | 2021-02-23T11:20:21.000Z | # coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... | 30.87473 | 276 | 0.632599 |
37b5b0c3a6f5c3d51943c6c393d21ff6af24e06e | 395 | py | Python | Task2G.py | AJB363/PartIA-Flood-Warning-System | 713cbb64f272d4a598942cf89292a39a1a05c30a | [
"MIT"
] | null | null | null | Task2G.py | AJB363/PartIA-Flood-Warning-System | 713cbb64f272d4a598942cf89292a39a1a05c30a | [
"MIT"
] | null | null | null | Task2G.py | AJB363/PartIA-Flood-Warning-System | 713cbb64f272d4a598942cf89292a39a1a05c30a | [
"MIT"
] | null | null | null | from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.flood import towns_most_at_risk
def run():
"""Requirements for Task 2G"""
stations = build_station_list()[:25]
update_water_levels(stations)
print(towns_most_at_risk(stations, 10))
if __name__ == '__main__':... | 26.333333 | 75 | 0.729114 |
c7a52e7cdc7a6a033602ffc3b75d500ca4a8a979 | 1,848 | py | Python | aardvark/server/menu/models.py | OthmanEmpire/team_aardvark | 5925109d5fde419be2318f34e3cde7f6c196d3f1 | [
"MIT"
] | null | null | null | aardvark/server/menu/models.py | OthmanEmpire/team_aardvark | 5925109d5fde419be2318f34e3cde7f6c196d3f1 | [
"MIT"
] | null | null | null | aardvark/server/menu/models.py | OthmanEmpire/team_aardvark | 5925109d5fde419be2318f34e3cde7f6c196d3f1 | [
"MIT"
] | null | null | null | from decimal import Decimal
from django.db import models
from django.contrib import admin
class Food(models.Model):
"""
Model that represents a food item on the restaurant menu.
Attributes:
:name: The name of the food.
:type: The type of the food limited to: "sta... | 30.8 | 74 | 0.534632 |
37934e90ae4a425bdb76ccfcbdab38e26b87e28e | 799 | py | Python | tutorials/2_tensorflow_old/tkinterTUT/tk3_entry_text.py | wull566/tensorflow_demo | c2c45050867cb056b8193eb53466d26b80b0ec13 | [
"MIT"
] | 2 | 2019-03-24T12:58:17.000Z | 2021-05-18T06:21:21.000Z | tutorials/2_tensorflow_old/tkinterTUT/tk3_entry_text.py | wull566/tensorflow_demo | c2c45050867cb056b8193eb53466d26b80b0ec13 | [
"MIT"
] | null | null | null | tutorials/2_tensorflow_old/tkinterTUT/tk3_entry_text.py | wull566/tensorflow_demo | c2c45050867cb056b8193eb53466d26b80b0ec13 | [
"MIT"
] | null | null | null | # View more 3_python 1_tensorflow_new tutorial on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
import tkinter as tk
window = tk.Tk()
window.title('my window')
window.geometry('200x200')
# e... | 24.212121 | 82 | 0.667084 |
1f935da354157f4b574198313ea75a6e37025122 | 1,164 | py | Python | mcx/distributions/discrete_uniform.py | tblazina/mcx | d3529d71d0e302e1c2dcde9cc669fcb0769c71cc | [
"Apache-2.0"
] | null | null | null | mcx/distributions/discrete_uniform.py | tblazina/mcx | d3529d71d0e302e1c2dcde9cc669fcb0769c71cc | [
"Apache-2.0"
] | null | null | null | mcx/distributions/discrete_uniform.py | tblazina/mcx | d3529d71d0e302e1c2dcde9cc669fcb0769c71cc | [
"Apache-2.0"
] | null | null | null | from jax import lax
from jax import numpy as jnp
from jax import random
from mcx.distributions import constraints
from mcx.distributions.distribution import Distribution
from mcx.distributions.shapes import promote_shapes
class DiscreteUniform(Distribution):
"""Random variable with a uniform distribution on a ra... | 36.375 | 79 | 0.717354 |
662d27a8c1a621b344b54ca7375a0be2b02e6d42 | 2,819 | py | Python | examples/language_model/gpt/predict.py | chenyu-2020/PaddleNLP | 805c7894b735e73de5d15cc4bd06ab26d2149e9f | [
"Apache-2.0"
] | 6 | 2021-06-08T13:19:35.000Z | 2021-06-24T15:08:54.000Z | examples/language_model/gpt/predict.py | hting104/PaddleNLP | eea6c543b6a6d28504d914d5b0c82042a5e838c4 | [
"Apache-2.0"
] | null | null | null | examples/language_model/gpt/predict.py | hting104/PaddleNLP | eea6c543b6a6d28504d914d5b0c82042a5e838c4 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 36.141026 | 88 | 0.684285 |
4fc9f7114cd1c5dd7c469ba2af5437bf77cdc886 | 1,360 | py | Python | etc/list_all_module_names.py | mpardalos/memalloy | 9ea8e0e96c0630b138ecc9eb3e06102ccb1fab01 | [
"MIT"
] | 20 | 2016-09-25T12:36:19.000Z | 2021-04-20T18:44:26.000Z | etc/list_all_module_names.py | mpardalos/memalloy | 9ea8e0e96c0630b138ecc9eb3e06102ccb1fab01 | [
"MIT"
] | 23 | 2017-02-19T13:14:57.000Z | 2019-07-25T16:57:59.000Z | etc/list_all_module_names.py | mpardalos/memalloy | 9ea8e0e96c0630b138ecc9eb3e06102ccb1fab01 | [
"MIT"
] | 7 | 2016-11-01T22:57:42.000Z | 2019-07-11T13:45:12.000Z | # MIT License
#
# Copyright (c) 2017 by John Wickerson
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify,... | 42.5 | 72 | 0.733824 |
7083b2d37b2f8e9592e970c2dedac142485dbf4a | 501 | py | Python | lib/proxy.py | RezSat/Instagram-Bruteforcer | 24af9ff7685ecc770ecccc735417f2d5f2cf9c29 | [
"MIT"
] | 1 | 2021-09-18T16:43:15.000Z | 2021-09-18T16:43:15.000Z | lib/proxy.py | yehan-wasura/Instagram-Bruteforcer | 24af9ff7685ecc770ecccc735417f2d5f2cf9c29 | [
"MIT"
] | null | null | null | lib/proxy.py | yehan-wasura/Instagram-Bruteforcer | 24af9ff7685ecc770ecccc735417f2d5f2cf9c29 | [
"MIT"
] | 1 | 2021-04-23T23:57:36.000Z | 2021-04-23T23:57:36.000Z | # Date: 4/17/2020
# Author: Yehan Wasura
# Description: Proxy
class Proxy(object):
def __init__(self, proxy):
self.proxy = proxy
@property
def ip(self):
return self.proxy['ip']
@property
def port(self):
return self.proxy['port']
@property
def country(self):
... | 18.555556 | 67 | 0.570858 |
96595b140c47834a0f62bf38dde01efd63805209 | 3,145 | py | Python | app.py | Durhamster/TweetScraper | 82f0fe28f26d2d11ce7430f1cefe0e2724a20a38 | [
"MIT"
] | 7 | 2021-11-15T11:39:42.000Z | 2022-02-07T17:40:16.000Z | app.py | Durhamster/TweetScraper | 82f0fe28f26d2d11ce7430f1cefe0e2724a20a38 | [
"MIT"
] | null | null | null | app.py | Durhamster/TweetScraper | 82f0fe28f26d2d11ce7430f1cefe0e2724a20a38 | [
"MIT"
] | 3 | 2021-12-05T07:54:23.000Z | 2022-01-02T21:33:02.000Z | from os import makedirs, path
from tweet_funcs import (
cwd,
check_handles,
format_tweets,
get_follower_count,
get_follower_list,
get_tweets_multi,
get_tweets_single,
load_text,
tweets_dict,
)
if __name__ == "__main__":
# Creates scraped data folder if it does not exist
if... | 34.944444 | 111 | 0.588235 |
575c6296428997518f6929b8ec47c05b1c212365 | 4,178 | py | Python | e2e_tests/tests/nightly/test_distributed.py | ryantd/determined | b4f3be3c1878a9a7fdad4775647018753b39ef21 | [
"Apache-2.0"
] | 1 | 2021-03-29T04:25:27.000Z | 2021-03-29T04:25:27.000Z | e2e_tests/tests/nightly/test_distributed.py | hexieshenghuo/determined | 1e0948d89373ac26e3134c94591114c0951090d6 | [
"Apache-2.0"
] | null | null | null | e2e_tests/tests/nightly/test_distributed.py | hexieshenghuo/determined | 1e0948d89373ac26e3134c94591114c0951090d6 | [
"Apache-2.0"
] | null | null | null | import pytest
from tests import config as conf
from tests import experiment as exp
@pytest.mark.distributed # type: ignore
def test_mnist_pytorch_distributed() -> None:
config = conf.load_config(conf.tutorials_path("mnist_pytorch/distributed.yaml"))
config = conf.set_max_length(config, {"batches": 200})
... | 39.790476 | 97 | 0.770943 |
594376fe1bb779cef7aa311532f721c59a48685b | 7,965 | py | Python | custom_components/hilo/sensor.py | francispoisson/hilo | d2a1fe644d456a3663b915c64b00f72921df6578 | [
"Unlicense"
] | 26 | 2021-01-29T15:55:51.000Z | 2022-03-31T16:42:29.000Z | custom_components/hilo/sensor.py | valleedelisle/hilo | ebd2c515c2a7613960090f0ecb089a8745794113 | [
"Unlicense"
] | 50 | 2021-02-01T22:43:50.000Z | 2021-12-23T17:22:11.000Z | custom_components/hilo/sensor.py | francispoisson/hilo | d2a1fe644d456a3663b915c64b00f72921df6578 | [
"Unlicense"
] | 15 | 2021-02-07T21:24:12.000Z | 2022-02-03T18:41:09.000Z | from homeassistant.const import (
ENERGY_KILO_WATT_HOUR,
ENERGY_WATT_HOUR,
DEVICE_CLASS_ENERGY,
DEVICE_CLASS_POWER,
DEVICE_CLASS_TEMPERATURE,
TEMP_CELSIUS,
POWER_WATT,
)
from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
)
from homeassistant.components.integration.sen... | 33.049793 | 130 | 0.669931 |
1c68dea3b2b378a9bdb14caec4d26469aacff630 | 1,193 | py | Python | setup.py | niravhjoshi/LAPyramid | 32f144dd2c43859ba375160b4019fcd41797766e | [
"Apache-2.0"
] | null | null | null | setup.py | niravhjoshi/LAPyramid | 32f144dd2c43859ba375160b4019fcd41797766e | [
"Apache-2.0"
] | null | null | null | setup.py | niravhjoshi/LAPyramid | 32f144dd2c43859ba375160b4019fcd41797766e | [
"Apache-2.0"
] | null | null | null | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.txt')) as f:
README = f.read()
with open(os.path.join(here, 'CHANGES.txt')) as f:
CHANGES = f.read()
requires = [
'pyramid',
'pyramid_chameleon',
'pyramid_d... | 23.86 | 65 | 0.58005 |
7e3b233e7504a3f409f5b9e29df4726cce139446 | 6,704 | py | Python | test/core/metaflow_test/cli_check.py | RobBlumberg/metaflow | 9f737e6026eee250c1593a2cb1d1c4b19a00adf4 | [
"Apache-2.0"
] | null | null | null | test/core/metaflow_test/cli_check.py | RobBlumberg/metaflow | 9f737e6026eee250c1593a2cb1d1c4b19a00adf4 | [
"Apache-2.0"
] | null | null | null | test/core/metaflow_test/cli_check.py | RobBlumberg/metaflow | 9f737e6026eee250c1593a2cb1d1c4b19a00adf4 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import subprocess
import json
from tempfile import NamedTemporaryFile
from metaflow.util import is_stringish
from . import (
MetaflowCheck,
AssertArtifactFailed,
AssertLogFailed,
truncate,
AssertCardFailed,
)
try:
# Python 2
import cPickle as pickle
except:
# Pyth... | 34.735751 | 88 | 0.501641 |
99ccc9588e1793ad8c93481c8a9cb6ffcb0f2cf7 | 81,018 | py | Python | astropy/utils/data.py | sagarchotalia/astropy | b49ad06b4de9577648a55d499d914e08baeef2c6 | [
"BSD-3-Clause"
] | null | null | null | astropy/utils/data.py | sagarchotalia/astropy | b49ad06b4de9577648a55d499d914e08baeef2c6 | [
"BSD-3-Clause"
] | null | null | null | astropy/utils/data.py | sagarchotalia/astropy | b49ad06b4de9577648a55d499d914e08baeef2c6 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions for accessing, downloading, and caching data files."""
import atexit
import contextlib
import errno
import fnmatch
import functools
import hashlib
import os
import io
import re
import shutil
import ssl
import sys
import urllib.request
import... | 38.616778 | 118 | 0.614444 |
26ee75d2eff023f8bc6ade706e939062ac7d100c | 350 | py | Python | res/TensorFlowPythonExamples/examples/gru/__init__.py | chogba6/ONE | 3d35259f89ee3109cfd35ab6f38c231904487f3b | [
"Apache-2.0"
] | 255 | 2020-05-22T07:45:29.000Z | 2022-03-29T23:58:22.000Z | res/TensorFlowPythonExamples/examples/gru/__init__.py | chogba6/ONE | 3d35259f89ee3109cfd35ab6f38c231904487f3b | [
"Apache-2.0"
] | 5,102 | 2020-05-22T07:48:33.000Z | 2022-03-31T23:43:39.000Z | res/TensorFlowPythonExamples/examples/gru/__init__.py | chogba6/ONE | 3d35259f89ee3109cfd35ab6f38c231904487f3b | [
"Apache-2.0"
] | 120 | 2020-05-22T07:51:08.000Z | 2022-02-16T19:08:05.000Z | import tensorflow as tf
from tensorflow import keras
model = keras.Sequential()
shape = (4, 4)
model.add(keras.layers.GRU(2, input_shape=shape))
# Note that this code will generate pb model only with TF 1.x.x
#
# to save model in TF 2.x.x use
# - to dump keras model: model.save("gru.h5")
# - to dump saved model: tf.s... | 26.923077 | 63 | 0.717143 |
56fbf4e797c9cfac4454342a114bbeee597fac9d | 551 | py | Python | desafio017.py | douglasoliveira96/Desafios_python | 1ebe6d84b1ce887d908c0a44a06875c618e7a85b | [
"MIT"
] | null | null | null | desafio017.py | douglasoliveira96/Desafios_python | 1ebe6d84b1ce887d908c0a44a06875c618e7a85b | [
"MIT"
] | null | null | null | desafio017.py | douglasoliveira96/Desafios_python | 1ebe6d84b1ce887d908c0a44a06875c618e7a85b | [
"MIT"
] | null | null | null | '''Faça um programa que leia o comprimento do cateto oposto e do cateto adjacente de um triângulo retângulo.
Calcule e mostre o comprimento da hipotenusa.
a = float(input('Digite quanto mede o cateto adjacente: '))
b = float(input('Digite quanto mede o cateto oposto: '))
h = (a**2 + b**2) ** (1/2)
print('A hipotenusa m... | 36.733333 | 108 | 0.6951 |
addcf06c9a84bfba50dc4579a2ab780eb61baf9e | 5,317 | py | Python | docs/conf.py | aj-prime/lbann | a4cf81386b3f43586057b5312192e180b1259add | [
"Apache-2.0"
] | null | null | null | docs/conf.py | aj-prime/lbann | a4cf81386b3f43586057b5312192e180b1259add | [
"Apache-2.0"
] | null | null | null | docs/conf.py | aj-prime/lbann | a4cf81386b3f43586057b5312192e180b1259add | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 30.039548 | 99 | 0.659394 |
2bdc196f8b1cb927bb5c28ec79db39984a16e022 | 4,120 | py | Python | benchmark/startQiskit2372.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit2372.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit2372.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=40
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_... | 34.621849 | 140 | 0.650485 |
4dde3974c3d0ad4e91703f490252f799f8bfac1d | 10,136 | py | Python | gui/qt/console.py | namuyan/electrum-fjc | 1a5c4a582f0fcdbaeca2b721ee729f43cd7915a2 | [
"MIT"
] | 1 | 2017-07-06T03:03:25.000Z | 2017-07-06T03:03:25.000Z | gui/qt/console.py | namuyan/electrum-fjc | 1a5c4a582f0fcdbaeca2b721ee729f43cd7915a2 | [
"MIT"
] | null | null | null | gui/qt/console.py | namuyan/electrum-fjc | 1a5c4a582f0fcdbaeca2b721ee729f43cd7915a2 | [
"MIT"
] | null | null | null | # source: http://stackoverflow.com/questions/2758159/how-to-embed-a-python-interpreter-in-a-pyqt-widget
import sys, os, re
import traceback, platform
from PyQt4 import QtCore
from PyQt4 import QtGui
from electrum_ltc import util
if platform.system() == 'Windows':
MONOSPACE_FONT = 'Lucida Console'
elif platform.s... | 31.675 | 123 | 0.562648 |
0d7904f3c619d8b7883485d8eff685c509b0fa61 | 57 | py | Python | pyrichlet/__init__.py | cabo40/pyrichlet | 941b84e3fcf3c92de2239767e96ee235ff165adb | [
"Apache-2.0"
] | 13 | 2022-02-13T00:33:47.000Z | 2022-03-08T16:28:27.000Z | pyrichlet/__init__.py | cabo40/pyrichlet | 941b84e3fcf3c92de2239767e96ee235ff165adb | [
"Apache-2.0"
] | null | null | null | pyrichlet/__init__.py | cabo40/pyrichlet | 941b84e3fcf3c92de2239767e96ee235ff165adb | [
"Apache-2.0"
] | null | null | null | from . import mixture_models
from . import weight_models
| 19 | 28 | 0.824561 |
04d13cf2f3948c2c00b3b42ff0381ac743644ec9 | 33,294 | py | Python | build/PureCloudPlatformClientV2/models/chat_media_participant.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | 10 | 2019-02-22T00:27:08.000Z | 2021-09-12T23:23:44.000Z | libs/PureCloudPlatformClientV2/models/chat_media_participant.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 5 | 2018-06-07T08:32:00.000Z | 2021-07-28T17:37:26.000Z | libs/PureCloudPlatformClientV2/models/chat_media_participant.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 6 | 2020-04-09T17:43:07.000Z | 2022-02-17T08:48:05.000Z | # coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | 32.292919 | 233 | 0.622725 |
2418fe8257ae9403d36253e48bc6a0ddec3f43f3 | 20,006 | py | Python | notebooks/data_cleaning.py | TuomoKareoja/us-song-lyrics-sentiment | 3d73e1876800687e126442d44edfe4dcbd2bf983 | [
"MIT"
] | null | null | null | notebooks/data_cleaning.py | TuomoKareoja/us-song-lyrics-sentiment | 3d73e1876800687e126442d44edfe4dcbd2bf983 | [
"MIT"
] | null | null | null | notebooks/data_cleaning.py | TuomoKareoja/us-song-lyrics-sentiment | 3d73e1876800687e126442d44edfe4dcbd2bf983 | [
"MIT"
] | null | null | null | # %%
import os
import matplotlib.pyplot as plt
import nltk
import numpy as np
import pandas as pd
import seaborn as sns
from afinn import Afinn
from IPython.core.interactiveshell import InteractiveShell
from langdetect import DetectorFactory, detect
from nltk.stem import WordNetLemmatizer
from wordcloud import WordCl... | 28.29703 | 88 | 0.638458 |
f2b6f3422f8d764118f3a11930b1f5d18722ddf7 | 11,551 | py | Python | torchdynamo/utils.py | frank-wei/torchdynamo | 26c4c1b593bebf4246e566749dade38254b59ffb | [
"BSD-3-Clause"
] | 40 | 2022-03-02T01:29:29.000Z | 2022-03-31T16:02:01.000Z | torchdynamo/utils.py | frank-wei/torchdynamo | 26c4c1b593bebf4246e566749dade38254b59ffb | [
"BSD-3-Clause"
] | 62 | 2022-03-11T00:12:37.000Z | 2022-03-31T20:04:27.000Z | torchdynamo/utils.py | frank-wei/torchdynamo | 26c4c1b593bebf4246e566749dade38254b59ffb | [
"BSD-3-Clause"
] | 4 | 2022-03-09T18:43:20.000Z | 2022-03-31T01:01:26.000Z | import collections
import dataclasses
import functools
import gc
import inspect
import itertools
import logging
import operator
import re
import time
import types
import weakref
from functools import lru_cache
from typing import Any
from typing import Dict
import torch
from torch import fx
from . import config
log =... | 27.968523 | 107 | 0.616397 |
b54c68f4bc619d367f5efcbf4ea56a7110f616b4 | 23,529 | py | Python | scripts/external_libs/jsonrpclib-pelix-0.4.1/jsonrpclib/SimpleJSONRPCServer.py | srakula-trex/trex-core | 5cd1fd93cd3766c76537ff57670a861b9bcec7b8 | [
"Apache-2.0"
] | 1 | 2020-09-06T00:58:34.000Z | 2020-09-06T00:58:34.000Z | scripts/external_libs/jsonrpclib-pelix-0.4.1/jsonrpclib/SimpleJSONRPCServer.py | srakula-trex/trex-core | 5cd1fd93cd3766c76537ff57670a861b9bcec7b8 | [
"Apache-2.0"
] | null | null | null | scripts/external_libs/jsonrpclib-pelix-0.4.1/jsonrpclib/SimpleJSONRPCServer.py | srakula-trex/trex-core | 5cd1fd93cd3766c76537ff57670a861b9bcec7b8 | [
"Apache-2.0"
] | 1 | 2021-09-13T13:43:10.000Z | 2021-09-13T13:43:10.000Z | #!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Defines a request dispatcher, a HTTP request handler, a HTTP server and a
CGI request handler.
:authors: Josh Marshall, Thomas Calmant
:copyright: Copyright 2020, Thomas Calmant
:license: Apache License 2.0
:version: 0.4.1
..
Copyright 2020 Thomas Calmant
... | 36.087423 | 81 | 0.589528 |
10b35b0be9f01d1151226643ba39a260d0fbd6c7 | 3,507 | py | Python | ci/scripts/compare_results.py | ltalirz/gfcc | 4fe9e677383e2d5626428d8e535d7f92807523b7 | [
"MIT"
] | 4 | 2020-10-14T17:43:00.000Z | 2021-06-21T08:23:01.000Z | ci/scripts/compare_results.py | ltalirz/gfcc | 4fe9e677383e2d5626428d8e535d7f92807523b7 | [
"MIT"
] | 3 | 2020-06-03T19:54:30.000Z | 2022-03-10T22:59:30.000Z | ci/scripts/compare_results.py | ltalirz/gfcc | 4fe9e677383e2d5626428d8e535d7f92807523b7 | [
"MIT"
] | 6 | 2020-06-08T03:54:16.000Z | 2022-03-02T17:47:51.000Z | #!/usr/bin/env python
import sys
import os
import json
import math
def isclose(a, b, rel_tol=1e-09, abs_tol=0):
return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)
if len(sys.argv) < 2:
print("\nUsage: python3 compare_results.py reference_results_path current_results_path")
sys.exit(1)
ref_res_... | 38.538462 | 183 | 0.641574 |
bc66e8a859743bc8c2703dfeb08158cea94c7ce1 | 1,192 | py | Python | pineboolib/fllegacy/tests/test_smtp.py | Aulla/pineboo | 3ad6412d365a6ad65c3bb2bdc03f5798d7c37004 | [
"MIT"
] | 2 | 2017-12-10T23:06:16.000Z | 2017-12-10T23:06:23.000Z | pineboolib/fllegacy/tests/test_smtp.py | Aulla/pineboo | 3ad6412d365a6ad65c3bb2bdc03f5798d7c37004 | [
"MIT"
] | 36 | 2017-11-05T21:13:47.000Z | 2020-08-26T15:56:15.000Z | pineboolib/fllegacy/tests/test_smtp.py | Aulla/pineboo | 3ad6412d365a6ad65c3bb2bdc03f5798d7c37004 | [
"MIT"
] | 8 | 2017-11-05T15:56:31.000Z | 2019-04-25T16:32:28.000Z | """Test_flutil module."""
import unittest
from pineboolib.fllegacy import flsmtpclient
from pineboolib import application
class TestSmtp(unittest.TestCase):
"""TestSmtp class."""
cli: flsmtpclient.FLSmtpClient
@classmethod
def setUpClass(cls) -> None:
"""Ensure pineboo is initialized for t... | 27.72093 | 97 | 0.655201 |
486645f74316c7c5064d52f7f23c9e778085358e | 23,780 | py | Python | networking_cisco/plugins/ml2/drivers/cisco/nexus/nexus_db_v2.py | mail2nsrajesh/networking-cisco | e072b149d26e0a9dd9d68755c874dfc047dc9c91 | [
"Apache-2.0"
] | null | null | null | networking_cisco/plugins/ml2/drivers/cisco/nexus/nexus_db_v2.py | mail2nsrajesh/networking-cisco | e072b149d26e0a9dd9d68755c874dfc047dc9c91 | [
"Apache-2.0"
] | null | null | null | networking_cisco/plugins/ml2/drivers/cisco/nexus/nexus_db_v2.py | mail2nsrajesh/networking-cisco | e072b149d26e0a9dd9d68755c874dfc047dc9c91 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013-2016 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | 32.890733 | 78 | 0.651976 |
a8d1adf3ae6c11fc66a26ea0aa34d4125307dc6d | 23,679 | py | Python | sdk/python/pulumi_aws/opsworks/haproxy_layer.py | Otanikotani/pulumi-aws | 00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/opsworks/haproxy_layer.py | Otanikotani/pulumi-aws | 00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/opsworks/haproxy_layer.py | Otanikotani/pulumi-aws | 00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... | 51.927632 | 224 | 0.675958 |
a77cd76b4ca9c24db930def1c771452aae5768f3 | 1,733 | py | Python | samples/generated_samples/aiplatform_generated_aiplatform_v1_job_service_get_model_deployment_monitoring_job_sync.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | 180 | 2020-09-23T17:21:15.000Z | 2022-03-30T17:25:47.000Z | samples/generated_samples/aiplatform_generated_aiplatform_v1_job_service_get_model_deployment_monitoring_job_sync.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | 601 | 2020-09-23T16:23:44.000Z | 2022-03-31T19:08:23.000Z | samples/generated_samples/aiplatform_generated_aiplatform_v1_job_service_get_model_deployment_monitoring_job_sync.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | 109 | 2020-09-23T16:22:04.000Z | 2022-03-28T21:18:29.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 36.104167 | 119 | 0.784766 |
72b429314e4cf3ba3e1d227d57f5edde06278503 | 7,621 | py | Python | ipysimulate/control.py | JoelForamitti/ipysimulate | 06753f9ef48c82b96b1b2c736accee3dcbbf1a22 | [
"BSD-3-Clause"
] | 5 | 2021-06-03T06:38:38.000Z | 2021-12-27T17:33:06.000Z | ipysimulate/control.py | JoelForamitti/ipysimulate | 06753f9ef48c82b96b1b2c736accee3dcbbf1a22 | [
"BSD-3-Clause"
] | null | null | null | ipysimulate/control.py | JoelForamitti/ipysimulate | 06753f9ef48c82b96b1b2c736accee3dcbbf1a22 | [
"BSD-3-Clause"
] | null | null | null | import traitlets
import ipywidgets
import threading
import time
import ipysimulate
from .tools import make_list
from .parameters import Range, IntRange, Values
# See js/lib/control.js for the frontend counterpart to this file.
semver_range = "~" + ipysimulate.__version__ # Retrieve version
# Prepare parameter classe... | 35.948113 | 79 | 0.572891 |
998dc8fb973c9f0299f2b21097f0138668147bc1 | 23,037 | py | Python | tests/test_charts.py | ahlusar1989/vincent | 95c60d62bdf21507e75cb2d1dc5e29d40fde8664 | [
"MIT"
] | 1,052 | 2015-01-03T16:17:37.000Z | 2022-01-31T22:29:18.000Z | tests/test_charts.py | mikemsq/vincent | 95c60d62bdf21507e75cb2d1dc5e29d40fde8664 | [
"MIT"
] | 28 | 2015-01-26T03:26:37.000Z | 2018-11-30T12:06:31.000Z | tests/test_charts.py | mikemsq/vincent | 95c60d62bdf21507e75cb2d1dc5e29d40fde8664 | [
"MIT"
] | 179 | 2015-01-05T06:27:17.000Z | 2022-02-08T05:52:29.000Z | # -*- coding: utf-8 -*-
"""
Test Vincent.charts
-------------------
Tests for Vincent chart types, which also serve as reference grammar.
"""
import pandas as pd
import nose.tools as nt
from vincent.charts import (data_type, Chart, Bar, Scatter, Line, Area,
GroupedBar, Map, Pie, Word)
de... | 33.679825 | 78 | 0.357642 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.