hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ffaa83bc476c29992c6bd0d1afe3b362bc913555 | 3,542 | py | Python | exercises/city_temperature_prediction.py | YaadLuria/IML.HUJI | d5cea7671009d14a37ebf9a308f16c2ca0087c92 | [
"MIT"
] | null | null | null | exercises/city_temperature_prediction.py | YaadLuria/IML.HUJI | d5cea7671009d14a37ebf9a308f16c2ca0087c92 | [
"MIT"
] | null | null | null | exercises/city_temperature_prediction.py | YaadLuria/IML.HUJI | d5cea7671009d14a37ebf9a308f16c2ca0087c92 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import plotly.io as pio
pio.templates.default = "simple_white"
def load_data(filename: str) -> pd.DataFrame:
"""
Load city daily temperature dataset and preprocess data.
Parameters
----------
filename: str
Path to house prices dataset
Returns
... | 34.057692 | 79 | 0.585827 | import numpy as np
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
import plotly.io as pio
from IMLearn.learners.regressors.polynomial_fitting import PolynomialFitting
from IMLearn.utils import utils
pio.templates.default = "simple_white"
def load_data(filename: str) -> pd.DataFram... | 0 | 0 | 0 | 0 | 0 | 2,073 | 0 | 83 | 158 |
6f1aab7ed5e79e2741e34abdc2904226123a279f | 539 | py | Python | phytorch/units/_si/_base_unit_map.py | emaballarin/phytorch | 68cf0a630e2fee9dd98f08639edcceb2389adf35 | [
"MIT"
] | 1 | 2022-01-21T06:59:20.000Z | 2022-01-21T06:59:20.000Z | phytorch/units/_si/_base_unit_map.py | emaballarin/phytorch | 68cf0a630e2fee9dd98f08639edcceb2389adf35 | [
"MIT"
] | null | null | null | phytorch/units/_si/_base_unit_map.py | emaballarin/phytorch | 68cf0a630e2fee9dd98f08639edcceb2389adf35 | [
"MIT"
] | 1 | 2021-04-27T00:45:47.000Z | 2021-04-27T00:45:47.000Z | from more_itertools import one
from .._utils import names_and_abbrevs
from ..unit import CURRENT, Dimension, LENGTH, MASS, TEMPERATURE, TIME, Unit
base_unit_map = {
(names, abbrevs): Unit(dim, name=one(abbrevs))
for (names, abbrevs), dim in {
names_and_abbrevs(item): {val: 1} if isinstance(val, Dimen... | 31.705882 | 80 | 0.619666 | from more_itertools import one
from .._utils import names_and_abbrevs
from ..unit import CURRENT, Dimension, LENGTH, MASS, TEMPERATURE, TIME, Unit
base_unit_map = {
(names, abbrevs): Unit(dim, name=one(abbrevs))
for (names, abbrevs), dim in {
names_and_abbrevs(item): {val: 1} if isinstance(val, Dimen... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
486aefbceec6a94c296613fb3b8e92c8ab9eb57c | 1,183 | py | Python | vitrageclient/v1/cli/service.py | openstack/python-vitrageclient | cb9d0ee604f96e59f5018b5a59e3be07f73214cd | [
"Apache-2.0"
] | 20 | 2015-12-08T09:31:45.000Z | 2021-04-30T03:57:10.000Z | vitrageclient/v1/cli/service.py | openstack/python-vitrageclient | cb9d0ee604f96e59f5018b5a59e3be07f73214cd | [
"Apache-2.0"
] | null | null | null | vitrageclient/v1/cli/service.py | openstack/python-vitrageclient | cb9d0ee604f96e59f5018b5a59e3be07f73214cd | [
"Apache-2.0"
] | 2 | 2018-03-18T07:42:22.000Z | 2018-08-22T12:30:26.000Z | # Copyright 2019 - Nokia 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... | 33.8 | 76 | 0.665258 | # Copyright 2019 - Nokia 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... | 0 | 0 | 0 | 505 | 0 | 0 | 0 | 20 | 68 |
58c5fe62872f6f69f501811886a37c9cfbb541e6 | 7,324 | py | Python | tests/rate_limit_test.py | FreCap/python-redis-rate-limit | 5d3856490b6e63edb1c24251421bc853c866f19e | [
"MIT"
] | 105 | 2016-07-25T20:42:55.000Z | 2022-02-01T10:45:39.000Z | tests/rate_limit_test.py | FreCap/python-redis-rate-limit | 5d3856490b6e63edb1c24251421bc853c866f19e | [
"MIT"
] | 19 | 2016-07-25T21:48:09.000Z | 2022-03-22T21:42:52.000Z | tests/rate_limit_test.py | FreCap/python-redis-rate-limit | 5d3856490b6e63edb1c24251421bc853c866f19e | [
"MIT"
] | 29 | 2016-07-25T13:41:18.000Z | 2022-03-22T21:32:16.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
if __name__ == '__main__':
unittest.main()
| 35.043062 | 79 | 0.635582 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import time
from redis_rate_limit import RateLimit, RateLimiter, TooManyRequests
class TestRedisRateLimit(unittest.TestCase):
def setUp(self):
"""
Initialises Rate Limit class and delete all keys from Redis.
"""
self.rat... | 0 | 48 | 0 | 7,060 | 0 | 0 | 0 | 37 | 67 |
74bbbd470e9f1b4ed11c01549c308022ece77b31 | 6,749 | py | Python | elastic_import-oneletters.py | VaticanEmbassy/elastipass-importer | b68b3e7d1a28be0694d1aa25a2c114de68ca47fa | [
"Apache-2.0"
] | null | null | null | elastic_import-oneletters.py | VaticanEmbassy/elastipass-importer | b68b3e7d1a28be0694d1aa25a2c114de68ca47fa | [
"Apache-2.0"
] | null | null | null | elastic_import-oneletters.py | VaticanEmbassy/elastipass-importer | b68b3e7d1a28be0694d1aa25a2c114de68ca47fa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
INDEX = 'passwd'
INDEX_PREFIX = 'pwd_'
DOC_TYPE = 'account'
INDEX_CFG = {
"settings": {
"index": {
#"number_of_shards": 8,
"refresh_interval": -1,
"number_of_replicas": 0
},
"analysis": {
... | 31.537383 | 116 | 0.361535 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import time
import string
import itertools
from elasticsearch import Elasticsearch, helpers
INDEX = 'passwd'
INDEX_PREFIX = 'pwd_'
DOC_TYPE = 'account'
INDEX_CFG = {
"settings": {
"index": {
#"number_of_shards": 8,
"refresh... | 0 | 0 | 0 | 0 | 1,359 | 1,056 | 0 | 4 | 134 |
c7c269b171233a25f78358c9589e001798132bf1 | 1,127 | py | Python | Evaluation/Plot_Boxplot_BestFrameworkDesigns.py | Lucciola111/stream_autoencoder_windowing | 5456b07bd20220c987598db2cdb832d8195e1575 | [
"MIT"
] | 4 | 2021-09-16T05:50:25.000Z | 2021-12-31T07:04:55.000Z | Evaluation/Plot_Boxplot_BestFrameworkDesigns.py | Lucciola111/stream_autoencoder_windowing | 5456b07bd20220c987598db2cdb832d8195e1575 | [
"MIT"
] | null | null | null | Evaluation/Plot_Boxplot_BestFrameworkDesigns.py | Lucciola111/stream_autoencoder_windowing | 5456b07bd20220c987598db2cdb832d8195e1575 | [
"MIT"
] | 1 | 2021-12-16T06:53:08.000Z | 2021-12-16T06:53:08.000Z | import seaborn as sns
import matplotlib.pyplot as plt
def plot_boxplot_best_framework_designs(data, plot_file_name=False, latex_font=True):
"""
Parameters
----------
data: Data for plot
plot_file_name: Optional name for plot
latex_font: Whether latex font should be used
Returns
-----... | 29.657895 | 98 | 0.655723 | import seaborn as sns
import matplotlib.pyplot as plt
def plot_boxplot_best_framework_designs(data, plot_file_name=False, latex_font=True):
"""
Parameters
----------
data: Data for plot
plot_file_name: Optional name for plot
latex_font: Whether latex font should be used
Returns
-----... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ecc1c1b8ed492ca1611ccc73bc8165dcca92bb62 | 628 | py | Python | curso/migrations/0009_auto_20191212_2023.py | Miguelrom/EasyApproval | 14bc48086ca20a2830d0ff17961a7cec84ea42bc | [
"Apache-2.0"
] | null | null | null | curso/migrations/0009_auto_20191212_2023.py | Miguelrom/EasyApproval | 14bc48086ca20a2830d0ff17961a7cec84ea42bc | [
"Apache-2.0"
] | 3 | 2019-12-03T22:36:30.000Z | 2019-12-12T01:27:34.000Z | curso/migrations/0009_auto_20191212_2023.py | Miguelrom/EasyApproval | 14bc48086ca20a2830d0ff17961a7cec84ea42bc | [
"Apache-2.0"
] | 12 | 2019-12-03T22:36:12.000Z | 2019-12-12T05:52:15.000Z | # Generated by Django 2.2.7 on 2019-12-13 03:23
| 26.166667 | 101 | 0.603503 | # Generated by Django 2.2.7 on 2019-12-13 03:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('curso', '0008_auto_20191212_1256'),
]
operations = [
migrations.AlterField(
model_name='curso',
name='departamento',... | 0 | 0 | 0 | 514 | 0 | 0 | 0 | 19 | 46 |
e1f9483e8e91ccf755f64600fd0c3b8c7a69dc41 | 682 | py | Python | Singleton/example_1.py | de-cryptor/Object-Oriented-Design-Python | 7e51b09b4481fc04f2833f7505c99f34708fbd02 | [
"MIT"
] | 1 | 2021-09-24T17:10:57.000Z | 2021-09-24T17:10:57.000Z | Singleton/example_1.py | de-cryptor/Object-Oriented-Design-Python | 7e51b09b4481fc04f2833f7505c99f34708fbd02 | [
"MIT"
] | null | null | null | Singleton/example_1.py | de-cryptor/Object-Oriented-Design-Python | 7e51b09b4481fc04f2833f7505c99f34708fbd02 | [
"MIT"
] | null | null | null | # classic implementation of Singleton Design pattern
# main method
if __name__ == "__main__":
# create object of Singleton Class
obj = Singleton()
print(obj)
# pick the instance of the class
obj = Singleton.getInstance()
print(obj)
| 21.3125 | 56 | 0.73607 | # classic implementation of Singleton Design pattern
class Singleton:
__shared_instance = 'GeeksforGeeks'
@staticmethod
def getInstance():
"""Static Access Method"""
if Singleton.__shared_instance == 'GeeksforGeeks':
Singleton()
return Singleton.__shared_instance
def __init__(self):
"""virtual priva... | 0 | 147 | 0 | 272 | 0 | 0 | 0 | 0 | 22 |
68fb4c62cc2a3d41f825e3d66f68f956cf6d02c7 | 4,140 | py | Python | lib/sigure.py | frozstone/concept | 359a386941d0752fd9ecf97edaa4e69c52952513 | [
"MIT"
] | null | null | null | lib/sigure.py | frozstone/concept | 359a386941d0752fd9ecf97edaa4e69c52952513 | [
"MIT"
] | null | null | null | lib/sigure.py | frozstone/concept | 359a386941d0752fd9ecf97edaa4e69c52952513 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
| 32.34375 | 109 | 0.635266 | #! /usr/bin/env python
from xml.dom import minidom
from ctypes import c_longlong
from mathml import cut_nomeaning_text, parse_file
class HashResult:
def __init__(self, value = 0, var_name = None):
assert type(value) == int
self.constant = value
if var_name:
self.coef = {var_nam... | 0 | 0 | 0 | 1,063 | 0 | 2,711 | 0 | 42 | 301 |
a3c8c908d647dceb699707d0463dc2d0401e5b16 | 6,497 | py | Python | openstack/utils.py | afontscd/openstacksdk | cb66a98f286dddabd1f593b45049c73192227186 | [
"Apache-2.0"
] | null | null | null | openstack/utils.py | afontscd/openstacksdk | cb66a98f286dddabd1f593b45049c73192227186 | [
"Apache-2.0"
] | null | null | null | openstack/utils.py | afontscd/openstacksdk | cb66a98f286dddabd1f593b45049c73192227186 | [
"Apache-2.0"
] | null | null | null | # 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... | 34.015707 | 79 | 0.668616 | # 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... | 0 | 0 | 0 | 147 | 1,217 | 0 | 0 | 1 | 97 |
d374764be9c2e17516901c51a66f19b6fb25a2ca | 549 | py | Python | tests/support/urls.py | armstrong/armstrong.apps.embeds | 6042f4ab39e752c4e78826e44f7c2aa82bc04e6a | [
"Apache-2.0"
] | 1 | 2016-08-02T09:33:35.000Z | 2016-08-02T09:33:35.000Z | tests/support/urls.py | armstrong/armstrong.apps.embeds | 6042f4ab39e752c4e78826e44f7c2aa82bc04e6a | [
"Apache-2.0"
] | null | null | null | tests/support/urls.py | armstrong/armstrong.apps.embeds | 6042f4ab39e752c4e78826e44f7c2aa82bc04e6a | [
"Apache-2.0"
] | 1 | 2018-03-04T20:30:15.000Z | 2018-03-04T20:30:15.000Z | from django.contrib import admin
try:
from django.conf.urls import patterns, include
except ImportError: # DROP_WITH_DJANGO13 pragma: no cover
from django.conf.urls.defaults import patterns, include
# DROP_WITH_DJANGO16
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.url... | 26.142857 | 73 | 0.761384 | from django.contrib import admin
try:
from django.conf.urls import patterns, include
except ImportError: # DROP_WITH_DJANGO13 pragma: no cover
from django.conf.urls.defaults import patterns, include
# DROP_WITH_DJANGO16
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.url... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c6e8c5c512a736a3ee25779d4d9d5b16ab40f095 | 7,069 | py | Python | motion_arbiter/src/tag_generator.py | ehwa009/social_mind | 0507f47b29371ef167b30b60bdd446fde118b626 | [
"Apache-2.0"
] | null | null | null | motion_arbiter/src/tag_generator.py | ehwa009/social_mind | 0507f47b29371ef167b30b60bdd446fde118b626 | [
"Apache-2.0"
] | null | null | null | motion_arbiter/src/tag_generator.py | ehwa009/social_mind | 0507f47b29371ef167b30b60bdd446fde118b626 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-*- encoding: utf8 -*-
import warnings
warnings.filterwarnings('ignore', category=RuntimeWarning)
from nltk.tokenize import word_tokenize
import rospy
# def predictions(text):
# clean = re.sub(r'[^ a-z A-Z 0-9]', " ", text)
# test_word = word_tokenize(clean)
# test_word = [w.lower(... | 34.99505 | 126 | 0.619324 | #!/usr/bin/env python
#-*- encoding: utf8 -*-
import warnings
warnings.filterwarnings('ignore', category=RuntimeWarning)
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.stem.lancaster import LancasterStemmer
from nltk import classify, pos_tag, word_tokenize
from keras.preprocessin... | 0 | 0 | 0 | 3,892 | 0 | 1,257 | 0 | 366 | 675 |
5a1078747a1f66a2ef17e47fc9adcfa98308e0b1 | 8,547 | py | Python | eoschar/charactersheet.py | fdfoneill/eoschar | 3feda15a40d324683918eb16fab59e72c1ec2da1 | [
"Unlicense"
] | null | null | null | eoschar/charactersheet.py | fdfoneill/eoschar | 3feda15a40d324683918eb16fab59e72c1ec2da1 | [
"Unlicense"
] | null | null | null | eoschar/charactersheet.py | fdfoneill/eoschar | 3feda15a40d324683918eb16fab59e72c1ec2da1 | [
"Unlicense"
] | null | null | null | import logging, os
logging.basicConfig(level=os.environ.get("LOGLEVEL","INFO"))
log = logging.getLogger(__name__) | 28.022951 | 165 | 0.684568 | import logging, os
logging.basicConfig(level=os.environ.get("LOGLEVEL","INFO"))
log = logging.getLogger(__name__)
import base64, json, pickle, sys
from ._version import __version__
from .choice import Choice,TextInput,PointBuy,AssignAbstractGear
from .dietype import DieType
from .sheetmaker import SheetMaker
from .fun... | 0 | 0 | 0 | 8,151 | 0 | 0 | 0 | 105 | 178 |
158571b32a423969991381d1c6e745f5bbeeb038 | 2,094 | py | Python | googleapi.py | AkBKukU/DemonetizationDetection | d98eb651d377f78228ef20e7d47d8dd0b53e948f | [
"MIT"
] | 9 | 2018-02-06T20:09:48.000Z | 2021-07-23T14:46:08.000Z | googleapi.py | AkBKukU/DemonetizationDetection | d98eb651d377f78228ef20e7d47d8dd0b53e948f | [
"MIT"
] | null | null | null | googleapi.py | AkBKukU/DemonetizationDetection | d98eb651d377f78228ef20e7d47d8dd0b53e948f | [
"MIT"
] | 3 | 2018-02-16T01:55:32.000Z | 2019-05-26T12:05:18.000Z | #!/usr/bin/python3
# python
# google
| 24.928571 | 70 | 0.668099 | #!/usr/bin/python3
# python
import http.client
import httplib2
import os
import random
import sys
import time
import webbrowser
import threading
import pprint
# google
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from googleapiclient.http import MediaFileUpload
from oauth2c... | 0 | 0 | 0 | 1,620 | 0 | 0 | 0 | 80 | 353 |
19389a8ffda5d2fe51847e8795a5cd01afb0710a | 7,108 | py | Python | batch_adapter_trim.py | alliemacleay/misc | d3429c07e85ca7234c8102e128888b7c3ee88e0d | [
"MIT"
] | null | null | null | batch_adapter_trim.py | alliemacleay/misc | d3429c07e85ca7234c8102e128888b7c3ee88e0d | [
"MIT"
] | null | null | null | batch_adapter_trim.py | alliemacleay/misc | d3429c07e85ca7234c8102e128888b7c3ee88e0d | [
"MIT"
] | null | null | null | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# There's no good way in cosmos to create a tag
# based on output or to conditionally run a process
# This is a wrapper to run the umi utilities.
#
# Run a program (SeqPrep) for a directory in batches
# This is a helper script for Martin Aryee's
# scripts to de... | 32.605505 | 162 | 0.522651 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# There's no good way in cosmos to create a tag
# based on output or to conditionally run a process
# This is a wrapper to run the umi utilities.
#
# Run a program (SeqPrep) for a directory in batches
# This is a helper script for Martin Aryee's
# scripts to de... | 0 | 0 | 0 | 0 | 0 | 3,185 | 0 | 0 | 111 |
522b7dac993beec57a3d1c6894e70ec79c5f911e | 809 | py | Python | tools/write_init.py | CodyKochmann/stock_info | 8de591b5a589aefebccab3650cb5dfea987ab4c8 | [
"MIT"
] | null | null | null | tools/write_init.py | CodyKochmann/stock_info | 8de591b5a589aefebccab3650cb5dfea987ab4c8 | [
"MIT"
] | null | null | null | tools/write_init.py | CodyKochmann/stock_info | 8de591b5a589aefebccab3650cb5dfea987ab4c8 | [
"MIT"
] | null | null | null | import os
from time import sleep
sleep(0.5)
targets=os.listdir('./')
targets.remove(file_name())
# remove __init__.py
if('__init__.py' in targets):
targets.remove('__init__.py')
# remove everything that isn't a python file
for i in list(targets):
if('.py' != i[-3:]):
targets.remove(i)
with open('./__init__.py... | 19.731707 | 89 | 0.652658 | import os
from time import sleep
sleep(0.5)
def file_name():
return(__file__.split('/')[-1])
targets=os.listdir('./')
targets.remove(file_name())
# remove __init__.py
if('__init__.py' in targets):
targets.remove('__init__.py')
# remove everything that isn't a python file
for i in list(targets):
if('.py' != i[-... | 0 | 0 | 0 | 0 | 0 | 114 | 0 | 0 | 46 |
d3dd88b25641094a26a2b76042b06441ee62950a | 822 | py | Python | tests/extension/src/test_project/__init__.py | felix-hilden/sphinx-codeautolink | cde00711e2359e30a76d6224a01da90104b06b19 | [
"MIT"
] | 21 | 2021-09-13T15:53:32.000Z | 2022-03-24T15:27:36.000Z | tests/extension/src/test_project/__init__.py | felix-hilden/sphinx-codeautolink | cde00711e2359e30a76d6224a01da90104b06b19 | [
"MIT"
] | 89 | 2021-09-19T21:42:38.000Z | 2022-03-25T09:09:39.000Z | tests/extension/src/test_project/__init__.py | felix-hilden/sphinx-codeautolink | cde00711e2359e30a76d6224a01da90104b06b19 | [
"MIT"
] | 5 | 2021-10-14T03:08:39.000Z | 2022-02-11T10:50:19.000Z | """Docstring."""
from typing import Optional, Union
def bar() -> Foo:
"""bar test function."""
def optional() -> Optional[Foo]:
"""Return optional type."""
def optional_manual() -> Union[None, Foo]:
"""Return manually constructed optional type."""
def optional_counter() -> Union[Foo, Baz]:
"""... | 16.117647 | 60 | 0.577859 | """Docstring."""
from typing import Optional, Union
from .sub import subfoo # NOQA
class Baz:
"""Baz test class."""
bute = 1
class Foo:
"""Foo test class."""
attr: str = 'test'
type_attr = Baz
def meth(self) -> Baz:
"""Test method."""
def selfref(self) -> "Foo":
"""... | 0 | 0 | 0 | 283 | 0 | 0 | 0 | 2 | 100 |
d6fa8b0b97db79dc18f50e0f8e7774c46d71ed91 | 2,983 | py | Python | handlers/inline_handlers.py | dark0ghost/async_py_bot | ec79285e5fbf5fc67661025effe596439107f21f | [
"MIT"
] | 24 | 2019-08-30T20:00:07.000Z | 2022-03-20T17:58:21.000Z | handlers/inline_handlers.py | dark0ghost/async_py_bot | ec79285e5fbf5fc67661025effe596439107f21f | [
"MIT"
] | 3 | 2020-02-12T19:48:21.000Z | 2021-03-07T19:24:50.000Z | handlers/inline_handlers.py | dark0ghost/async_py_bot | ec79285e5fbf5fc67661025effe596439107f21f | [
"MIT"
] | 3 | 2021-04-19T18:38:07.000Z | 2022-02-10T07:04:27.000Z | # This Python file uses the following encoding: utf-8
| 42.614286 | 114 | 0.623533 | # This Python file uses the following encoding: utf-8
import hashlib
from typing import List
from aiogram.types import InlineQuery, \
InputTextMessageContent, InlineQueryResultArticle
from core import dp, bot, lazy_get_text, cb as bank_api, crypto_price, Button
@dp.inline_handler()
async def inline_echo(inline_... | 206 | 2,589 | 0 | 0 | 0 | 0 | 0 | 124 | 113 |
44a7c2ab27ee10fde74535c1c75a01d06f25fdf2 | 2,466 | py | Python | test/test_cluster_controller_api.py | coveooss/spinnaker_python_client | 6f5ae436798cb4985ada65cd8169fcc9494d048f | [
"Apache-2.0"
] | null | null | null | test/test_cluster_controller_api.py | coveooss/spinnaker_python_client | 6f5ae436798cb4985ada65cd8169fcc9494d048f | [
"Apache-2.0"
] | null | null | null | test/test_cluster_controller_api.py | coveooss/spinnaker_python_client | 6f5ae436798cb4985ada65cd8169fcc9494d048f | [
"Apache-2.0"
] | 2 | 2019-10-17T07:49:21.000Z | 2021-08-10T23:12:41.000Z | # coding: utf-8
"""
Spinnaker API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import ... | 27.098901 | 125 | 0.683293 | # coding: utf-8
"""
Spinnaker API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import ... | 0 | 0 | 0 | 1,880 | 0 | 0 | 0 | 0 | 23 |
4217f7dc5437442ffcff16108ca2b818af48c163 | 10,650 | py | Python | src/healthnet/register/forms.py | blackpan2/HealthNet | 455402c4e437d3ef4136bfdfa8459fa31c06b069 | [
"MIT"
] | null | null | null | src/healthnet/register/forms.py | blackpan2/HealthNet | 455402c4e437d3ef4136bfdfa8459fa31c06b069 | [
"MIT"
] | null | null | null | src/healthnet/register/forms.py | blackpan2/HealthNet | 455402c4e437d3ef4136bfdfa8459fa31c06b069 | [
"MIT"
] | null | null | null | """
Application: HealthNet
File: /patientRegistration/forms.py
Authors:
- Nathan Stevens
- Phillip Bedward
- Daniel Herzig
- George Herde
- Samuel Launt
Description:
- This file contains all forms for Patient Registration.
"""
"""
Forms for registering u... | 44.008264 | 118 | 0.584601 | """
Application: HealthNet
File: /patientRegistration/forms.py
Authors:
- Nathan Stevens
- Phillip Bedward
- Daniel Herzig
- George Herde
- Samuel Launt
Description:
- This file contains all forms for Patient Registration.
"""
from django import forms
fro... | 0 | 0 | 0 | 9,679 | 0 | 0 | 0 | 202 | 429 |
c5637bd965405ae880b26d0ed437538fa2cdeffd | 2,344 | py | Python | preprocess/remove_tags.py | lilt/markup-transfer-scripts | 0b9c3552a5f40a89366124a29d36af2ca3e3b4fa | [
"MIT"
] | null | null | null | preprocess/remove_tags.py | lilt/markup-transfer-scripts | 0b9c3552a5f40a89366124a29d36af2ca3e3b4fa | [
"MIT"
] | null | null | null | preprocess/remove_tags.py | lilt/markup-transfer-scripts | 0b9c3552a5f40a89366124a29d36af2ca3e3b4fa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == '__main__':
args = parse_args()
with open(args.input, 'r') as fi, open(args.output, 'w') as fo:
for line in fi:
fo.write(extract_tags(line.strip()))
fo.write('\n')
| 30.441558 | 91 | 0.586177 | #!/usr/bin/env python3
import json
import argparse
from typing import List, NamedTuple
class Tag(NamedTuple):
content: str
opening_pos: int
closing_pos: int
def is_closing_tag(self) -> bool:
return self.content.startswith("</")
def is_self_closing_tag(self) -> bool:
return self.c... | 0 | 0 | 0 | 300 | 0 | 1,638 | 0 | -2 | 159 |
918e2c35e4588535dbf21714fdefd5c89b5b1baa | 1,225 | py | Python | models/siamese.py | chienlm297/Multi-label-for-volume-estimation | c14bf0a2b237e4ea580461524c280f85b8859ec9 | [
"MIT"
] | null | null | null | models/siamese.py | chienlm297/Multi-label-for-volume-estimation | c14bf0a2b237e4ea580461524c280f85b8859ec9 | [
"MIT"
] | null | null | null | models/siamese.py | chienlm297/Multi-label-for-volume-estimation | c14bf0a2b237e4ea580461524c280f85b8859ec9 | [
"MIT"
] | null | null | null | import torch.nn as nn
# for test
if __name__ == "__main__":
net = Siamese()
print(net)
print(list(net.parameters()))
| 26.630435 | 71 | 0.514286 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Siamese(nn.Module):
def __init__(self):
super(Siamese, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(1, 64, 10), # 64@96*96
nn.ReLU(inplace=True),
nn.MaxPool2d(2), # 64@48*48
... | 0 | 0 | 0 | 1,025 | 0 | 0 | 0 | 1 | 67 |
f87a882b7913d0ff2b31fa7b88d39c95fa8f2e65 | 1,722 | py | Python | pysilcam/tests/test_config.py | Sondreab/PySilCam | a855f769fee8f86a364f9dc2c448c74a7a71c2a6 | [
"BSD-3-Clause"
] | 4 | 2018-08-28T19:05:21.000Z | 2019-01-15T18:01:49.000Z | pysilcam/tests/test_config.py | Sondreab/PySilCam | a855f769fee8f86a364f9dc2c448c74a7a71c2a6 | [
"BSD-3-Clause"
] | 5 | 2018-10-24T09:17:25.000Z | 2020-04-08T12:17:57.000Z | pysilcam/tests/test_config.py | Sondreab/PySilCam | a855f769fee8f86a364f9dc2c448c74a7a71c2a6 | [
"BSD-3-Clause"
] | 2 | 2019-11-18T12:20:04.000Z | 2020-04-06T05:46:31.000Z | # -*- coding: utf-8 -*-
| 31.309091 | 77 | 0.70151 | # -*- coding: utf-8 -*-
import os
from pysilcam.config import load_config, PySilcamSettings, load_camera_config
def test_config_parser():
path = os.path.dirname(__file__)
filename = os.path.join(path, '..', 'config_example.ini')
conf = load_config(filename)
assert 'General' in conf
assert conf... | 0 | 0 | 0 | 0 | 0 | 1,535 | 0 | 44 | 116 |
c258b36fa7fd0e79947549c2935d7b42691ee4f3 | 87 | py | Python | courses/algos/main_project/basics/calc/utest_basics_calc/ref_basics_calc.py | obs145628/ml-notebooks | 08a64962e106ec569039ab204a7ae4c900783b6b | [
"MIT"
] | 1 | 2020-10-29T11:26:00.000Z | 2020-10-29T11:26:00.000Z | courses/algos/main_project/basics/calc/utest_basics_calc/ref_basics_calc.py | obs145628/ml-notebooks | 08a64962e106ec569039ab204a7ae4c900783b6b | [
"MIT"
] | 5 | 2021-03-18T21:33:45.000Z | 2022-03-11T23:34:50.000Z | courses/algos/main_project/basics/calc/utest_basics_calc/ref_basics_calc.py | obs145628/ml-notebooks | 08a64962e106ec569039ab204a7ae4c900783b6b | [
"MIT"
] | 1 | 2019-12-23T21:50:02.000Z | 2019-12-23T21:50:02.000Z | import sys
in_str = sys.stdin.read().replace('/', '//')
res = eval(in_str)
print(res)
| 14.5 | 44 | 0.632184 | import sys
in_str = sys.stdin.read().replace('/', '//')
res = eval(in_str)
print(res)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4e51a5f7c04597377ac9064b2c0566a4faa748e0 | 1,605 | py | Python | inference/dataset/__init__.py | DSincerity/CALM | 619a55abf1b91693ed698356e55077714ca50bb2 | [
"BSD-2-Clause"
] | null | null | null | inference/dataset/__init__.py | DSincerity/CALM | 619a55abf1b91693ed698356e55077714ca50bb2 | [
"BSD-2-Clause"
] | null | null | null | inference/dataset/__init__.py | DSincerity/CALM | 619a55abf1b91693ed698356e55077714ca50bb2 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# with-paraphrase dataset | 76.428571 | 118 | 0.885358 | # -*- coding: utf-8 -*-
from .rte_dataset import RTEAutoInferenceDataset, RTEAutoInferenceReverseDataset, RTEAutoInferenceSignalDataset, \
RTET5InferenceDataset, RTET5InferenceReverseDataset, RTET5InferenceSignalDataset
from .mnli_dataset import MNLIAutoInferenceDataset, MNLIAutoInferenceReverseDataset, MNLIAutoInf... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,357 | 198 |
8a6c1d3903bfd9a286042475643f7f89c2cad44a | 1,681 | py | Python | setup.py | Altinity/altinity-datasets | 9a48ef5d24b7f07c0a28ed9e17b55be22a6ae554 | [
"Apache-2.0"
] | 15 | 2019-06-17T07:46:17.000Z | 2021-01-25T18:28:30.000Z | setup.py | Altinity/altinity-datasets | 9a48ef5d24b7f07c0a28ed9e17b55be22a6ae554 | [
"Apache-2.0"
] | null | null | null | setup.py | Altinity/altinity-datasets | 9a48ef5d24b7f07c0a28ed9e17b55be22a6ae554 | [
"Apache-2.0"
] | 3 | 2019-08-08T07:41:49.000Z | 2020-10-27T07:07:17.000Z | # Copyright (c) 2019 Altinity LTD
#
# This product is licensed to you under the
# Apache License, Version 2.0 (the "License").
# You may not use this product except in compliance with the License.
#
# This product may include a number of subcomponents with
# separate copyright notices and license terms. Your use of the... | 29.491228 | 73 | 0.69304 | # Copyright (c) 2019 Altinity LTD
#
# This product is licensed to you under the
# Apache License, Version 2.0 (the "License").
# You may not use this product except in compliance with the License.
#
# This product may include a number of subcomponents with
# separate copyright notices and license terms. Your use of the... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 23 |
0c22cf23c0c0468ce79717df2071e184aaf07b75 | 1,518 | py | Python | src/mds/api/v1/util.py | m-socha/sana.mds | 4d3b71b7ba939c91570fee4f60444cf07035bd51 | [
"BSD-3-Clause"
] | 2 | 2016-05-19T02:32:13.000Z | 2017-09-06T07:06:25.000Z | src/mds/api/v1/util.py | m-socha/sana.mds | 4d3b71b7ba939c91570fee4f60444cf07035bd51 | [
"BSD-3-Clause"
] | 6 | 2015-07-19T17:40:49.000Z | 2016-12-20T21:54:59.000Z | src/mds/api/v1/util.py | m-socha/sana.mds | 4d3b71b7ba939c91570fee4f60444cf07035bd51 | [
"BSD-3-Clause"
] | 14 | 2015-10-30T09:50:21.000Z | 2019-06-15T13:07:37.000Z | """ A collection of utility methods
:Authors: Sana dev team
:Version: 1.1
"""
import sys, traceback
from django.conf import settings
LOGGING_ENABLED = 'LOGGING_ENABLE'
LOGGING_START = 'LOGGING_START_TIME'
def trace(f):
"""Decorator to add traces to a method.
"""
new_f.func_name = f.func_name
retur... | 24.095238 | 78 | 0.646904 | """ A collection of utility methods
:Authors: Sana dev team
:Version: 1.1
"""
import os, sys, traceback
import time
import logging
import cjson
from django.conf import settings
LOGGING_ENABLED = 'LOGGING_ENABLE'
LOGGING_START = 'LOGGING_START_TIME'
def trace(f):
"""Decorator to add traces to a method.
"""... | 0 | 0 | 0 | 0 | 0 | 231 | 0 | -22 | 92 |
28fc71c8afc805a515c13a9eb71312c89b89fdb2 | 5,979 | py | Python | confluent_server/confluent/netutil.py | andywray/confluent | 14577be963d84982a7c40d0360a9a35fd5046e2a | [
"Apache-2.0"
] | null | null | null | confluent_server/confluent/netutil.py | andywray/confluent | 14577be963d84982a7c40d0360a9a35fd5046e2a | [
"Apache-2.0"
] | null | null | null | confluent_server/confluent/netutil.py | andywray/confluent | 14577be963d84982a7c40d0360a9a35fd5046e2a | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2017 Lenovo
#
# 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 ... | 39.86 | 121 | 0.657802 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2017 Lenovo
#
# 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 ... | 0 | 0 | 0 | 0 | 0 | 1,852 | 0 | -3 | 113 |
030f933748d255e3106e631b8694892717c23a08 | 331 | py | Python | informatiom/test.py | wangcan-code/information11 | e4f494eefbb6f5365f941512ec6c68fb715c61c9 | [
"MIT"
] | null | null | null | informatiom/test.py | wangcan-code/information11 | e4f494eefbb6f5365f941512ec6c68fb715c61c9 | [
"MIT"
] | null | null | null | informatiom/test.py | wangcan-code/information11 | e4f494eefbb6f5365f941512ec6c68fb715c61c9 | [
"MIT"
] | null | null | null | # !/usr/bin/env python
# -*- coding: UTF-8 -*-
from flask import Flask
app=Flask(__name__)
# app.config.from_pyfile('config.ini')
# app.config.from_envvar('FLASKCONFIG')
if __name__ == '__main__':
print(app.url_map)
app.run(host="0.0.0.0", port=5000, debug = True)
| 20.6875 | 52 | 0.65861 | # !/usr/bin/env python
# -*- coding: UTF-8 -*-
from flask import Flask
app=Flask(__name__)
# app.config.from_pyfile('config.ini')
# app.config.from_envvar('FLASKCONFIG')
@app.route('/')
def index():
return 'hello python'
if __name__ == '__main__':
print(app.url_map)
app.run(host="0.0.0.0", port=5000, deb... | 0 | 33 | 0 | 0 | 0 | 0 | 0 | 0 | 23 |
7243f750f770968e7cc35df2bf22b2110bee7427 | 2,523 | py | Python | purchasing/data/importer/importer.py | hamhands/pittsburgh-purchasing-suite | a79aa77c00c95da8f0b3e2f5f7f7143d5857de35 | [
"BSD-3-Clause"
] | 22 | 2015-05-08T15:30:42.000Z | 2021-04-24T20:26:32.000Z | purchasing/data/importer/importer.py | hamhands/pittsburgh-purchasing-suite | a79aa77c00c95da8f0b3e2f5f7f7143d5857de35 | [
"BSD-3-Clause"
] | 516 | 2015-04-23T18:14:40.000Z | 2017-11-08T19:27:41.000Z | purchasing/data/importer/importer.py | CityofPittsburgh/pittsburgh-purchasing-suite | d676ed9c137e5aaa100992a798acd60ac464a2c1 | [
"BSD-3-Clause"
] | 10 | 2015-07-08T19:00:10.000Z | 2021-03-15T18:56:54.000Z | # -*- coding: utf-8 -*-
import csv
def convert_empty_to_none(val):
'''Converts empty or "None" strings to None Types
Arguments:
val: The field to be converted
Returns:
The passed value if the value is not an empty string or
'None', ``None`` otherwise.
'''
return val if va... | 29.337209 | 103 | 0.636544 | # -*- coding: utf-8 -*-
import csv
def convert_empty_to_none(val):
'''Converts empty or "None" strings to None Types
Arguments:
val: The field to be converted
Returns:
The passed value if the value is not an empty string or
'None', ``None`` otherwise.
'''
return val if va... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
821fcea7c9bb45c93c9fd75c7d0496c73aa80b0f | 974 | py | Python | setup.py | kamilazdybal/PCAfold | 251ca0dc8c8f98976266b94147504247ddd09bd2 | [
"MIT"
] | 2 | 2021-06-23T12:57:40.000Z | 2021-06-24T17:17:23.000Z | setup.py | ElsevierSoftwareX/SOFTX-D-20-00048 | 14ad08a492ec23d70e0a18d2b9a8493b2d681616 | [
"MIT"
] | null | null | null | setup.py | ElsevierSoftwareX/SOFTX-D-20-00048 | 14ad08a492ec23d70e0a18d2b9a8493b2d681616 | [
"MIT"
] | 1 | 2022-03-13T13:19:56.000Z | 2022-03-13T13:19:56.000Z | from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from numpy import get_include as numpy_include
import os
import platform
cython_extra_compile_args = ['-O3', '-g', '-I' + numpy_include(), '-ffast-math']
is_mac = platform.system() == 'Darwin'
if is_mac:
... | 37.461538 | 127 | 0.666324 | from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from numpy import get_include as numpy_include
import os
import platform
cython_extra_compile_args = ['-O3', '-g', '-I' + numpy_include(), '-ffast-math']
is_mac = platform.system() == 'Darwin'
if is_mac:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a5d7983a41da0d69983fbe94a8f1cc7b2f0b4570 | 2,628 | py | Python | demo_bot.py | VFDan/discord-ext-slash | 86181d467627843fc7793063a050c1d77b7cd8f9 | [
"MIT"
] | null | null | null | demo_bot.py | VFDan/discord-ext-slash | 86181d467627843fc7793063a050c1d77b7cd8f9 | [
"MIT"
] | null | null | null | demo_bot.py | VFDan/discord-ext-slash | 86181d467627843fc7793063a050c1d77b7cd8f9 | [
"MIT"
] | null | null | null | import os
import logging
from discord.ext import slash
client = slash.SlashBot(
# Pass help_command=None if the bot only uses slash commands
command_prefix='/', description='', help_command=None,
debug_guild=int(os.environ.get('DISCORD_DEBUG_GUILD', 0)) or None
)
emote_opt = slash.Option(
description=... | 33.692308 | 83 | 0.69102 | import os
import logging
import discord
from discord.ext import slash
client = slash.SlashBot(
# Pass help_command=None if the bot only uses slash commands
command_prefix='/', description='', help_command=None,
debug_guild=int(os.environ.get('DISCORD_DEBUG_GUILD', 0)) or None
)
@client.slash_cmd()
async d... | 0 | 1,641 | 0 | 0 | 0 | 0 | 0 | -7 | 183 |
58d0c9f86fe3b195c681abccf6a6de939f2f0b41 | 772 | py | Python | src/ebay_rest/api/sell_marketing/api/__init__.py | gbm001/ebay_rest | 077d3478423ccd80ff35e0361821d6a11180bc54 | [
"MIT"
] | 3 | 2021-12-12T04:28:03.000Z | 2022-03-10T03:29:18.000Z | src/ebay_rest/api/sell_marketing/api/__init__.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 33 | 2021-06-16T20:44:36.000Z | 2022-03-30T14:55:06.000Z | src/ebay_rest/api/sell_marketing/api/__init__.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 7 | 2021-06-03T09:30:23.000Z | 2022-03-08T19:51:33.000Z | from __future__ import absolute_import
# flake8: noqa
# import apis into api package
| 48.25 | 88 | 0.860104 | from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from ...sell_marketing.api.ad_api import AdApi
from ...sell_marketing.api.ad_report_api import AdReportApi
from ...sell_marketing.api.ad_report_metadata_api import AdReportMetadataApi
from ...sell_marketing.api.ad_report_task_api imp... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 465 | 220 |
0ef7a74a82a1393787e038c09cbdb7444501ebd1 | 2,187 | py | Python | cmdb/urls.py | 2xx4ever/cmdb | 4652e5c0d6b96eb76a0a8ca2b7bcc3d3eb6c8adf | [
"MIT"
] | 1 | 2017-12-04T08:04:01.000Z | 2017-12-04T08:04:01.000Z | cmdb/urls.py | 4O4nOtfOund/cmdb | 4652e5c0d6b96eb76a0a8ca2b7bcc3d3eb6c8adf | [
"MIT"
] | null | null | null | cmdb/urls.py | 4O4nOtfOund/cmdb | 4652e5c0d6b96eb76a0a8ca2b7bcc3d3eb6c8adf | [
"MIT"
] | null | null | null | # _*_ coding: utf-8 _*_
"""cmdb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, n... | 24.573034 | 79 | 0.609968 | # _*_ coding: utf-8 _*_
"""cmdb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, n... | 360 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 22 |
fe8a06d357a853d7e09011476bb00073231fb320 | 1,115 | py | Python | setup.py | YoungTrep/ufcpy | f3363dfcff9d1f1ed3f35bc33a8085a639d93a6d | [
"MIT"
] | 1 | 2021-08-22T14:00:38.000Z | 2021-08-22T14:00:38.000Z | setup.py | YoungTrep/ufcpy | f3363dfcff9d1f1ed3f35bc33a8085a639d93a6d | [
"MIT"
] | null | null | null | setup.py | YoungTrep/ufcpy | f3363dfcff9d1f1ed3f35bc33a8085a639d93a6d | [
"MIT"
] | null | null | null | import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='ufcpy',
version='2.0.1',
author='youngtrep',
author_email='youngtrep.business@gmail.com',
description='A fast and easy way to access the UFC roster',
long_description=long_description,... | 31.857143 | 96 | 0.611659 | import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='ufcpy',
version='2.0.1',
author='youngtrep',
author_email='youngtrep.business@gmail.com',
description='A fast and easy way to access the UFC roster',
long_description=long_description,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
856ca3e71bd2cdfe5fc4a4e30cfa0a2f4ea713c1 | 1,955 | py | Python | tests/test_string.py | fondat/fondat | 241b33301547a90e63e11febc51bc4f4fd8854d4 | [
"MIT"
] | 5 | 2021-01-08T19:50:18.000Z | 2022-01-09T06:23:16.000Z | tests/test_string.py | fondat/fondat | 241b33301547a90e63e11febc51bc4f4fd8854d4 | [
"MIT"
] | 1 | 2022-03-02T08:15:37.000Z | 2022-03-02T08:15:37.000Z | tests/test_string.py | fondat/fondat | 241b33301547a90e63e11febc51bc4f4fd8854d4 | [
"MIT"
] | 3 | 2021-02-03T01:02:18.000Z | 2022-02-25T22:59:37.000Z | import pytest
pytestmark = pytest.mark.asyncio
| 27.928571 | 57 | 0.653197 | import pytest
from fondat.string import Template
pytestmark = pytest.mark.asyncio
async def test_template_start():
async def resolver(variable: str) -> str:
return "World" if variable == "foo" else None
template = Template("${foo}, hello!")
result = "World, hello!"
assert await template.re... | 0 | 0 | 1,702 | 0 | 0 | 0 | 0 | 13 | 184 |
0914424e138d0e12cdefda87705deaa9e27eabcf | 2,420 | py | Python | src/networks.py | OsvaldFrisk/dp-not-all-noise-is-equal | a9293eab2e68577f5244d21c672cf18de33d5d29 | [
"MIT"
] | null | null | null | src/networks.py | OsvaldFrisk/dp-not-all-noise-is-equal | a9293eab2e68577f5244d21c672cf18de33d5d29 | [
"MIT"
] | null | null | null | src/networks.py | OsvaldFrisk/dp-not-all-noise-is-equal | a9293eab2e68577f5244d21c672cf18de33d5d29 | [
"MIT"
] | null | null | null | """Network Architectures"""
| 31.842105 | 84 | 0.593388 | """Network Architectures"""
from typing import Callable, List
import torch
from torch import nn
from torch.nn import functional as F
class SmallNetwork(nn.Module):
"""
Network used in the experiments on MNIST and Fashion MNIST.
"""
def __init__(self, act_func: Callable = torch.tanh) -> None:
... | 0 | 0 | 0 | 2,238 | 0 | 0 | 0 | 17 | 135 |
84a625573c38842b6185438bd046b74e11c4135b | 3,214 | py | Python | setup.py | gsjung0419/torchani | d95ab5dfeee4a25b5286d4b7f3446d2aecb36be3 | [
"MIT"
] | null | null | null | setup.py | gsjung0419/torchani | d95ab5dfeee4a25b5286d4b7f3446d2aecb36be3 | [
"MIT"
] | 11 | 2020-06-25T20:31:12.000Z | 2020-11-05T23:44:52.000Z | setup.py | IgnacioJPickering/torchani | 8776296d18b0ffc735f147578ece299458a041e0 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from distutils import log
import sys
BUILD_CUAEV = '--cuaev' in sys.argv
if BUILD_CUAEV:
sys.argv.remove('--cuaev')
if not BUILD_CUAEV:
log.warn("Will not install cuaev") # type: ignore
with open("README.md", "r") as fh:
long_description = fh.read()
setup... | 29.759259 | 94 | 0.624767 | import os
import glob
import subprocess
from setuptools import setup, find_packages
from distutils import log
import sys
BUILD_CUAEV = '--cuaev' in sys.argv
if BUILD_CUAEV:
sys.argv.remove('--cuaev')
if not BUILD_CUAEV:
log.warn("Will not install cuaev") # type: ignore
with open("README.md", "r") as fh:
... | 0 | 0 | 0 | 0 | 0 | 2,224 | 0 | -26 | 135 |
8300e6d0cf1ff07bec5a40f1e064322894a3bf78 | 896 | py | Python | utils/compile-proto.py | Alexey-N-Chernyshov/reblockstorer | 4ca47e39322ba11d6c32455448d3d183445a156e | [
"MIT"
] | 2 | 2019-06-17T14:54:54.000Z | 2019-12-03T06:42:03.000Z | utils/compile-proto.py | Alexey-N-Chernyshov/reblockstorer | 4ca47e39322ba11d6c32455448d3d183445a156e | [
"MIT"
] | null | null | null | utils/compile-proto.py | Alexey-N-Chernyshov/reblockstorer | 4ca47e39322ba11d6c32455448d3d183445a156e | [
"MIT"
] | 3 | 2019-06-21T07:30:31.000Z | 2019-10-30T05:56:41.000Z | #!/usr/bin/env python3
from six.moves import getoutput
import os.path
from os import chdir
directory = os.path.dirname(os.path.abspath(__file__))
chdir(directory)
print('Working directory set to {}'.format(directory))
proto_path = os.path.join('..', 'schema')
python_out = os.path.join('..', 'reblockstorer', 'proto')... | 34.461538 | 76 | 0.666295 | #!/usr/bin/env python3
from six.moves import getoutput
import os.path
from os import chdir
directory = os.path.dirname(os.path.abspath(__file__))
chdir(directory)
print('Working directory set to {}'.format(directory))
proto_path = os.path.join('..', 'schema')
python_out = os.path.join('..', 'reblockstorer', 'proto')... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cd5a4b0f486dd82e679fbbb52f347efba49a6362 | 4,017 | py | Python | argue/helpers.py | kennethreitz-archive/argue | d936d63c16b8afcfabfcc1bcf41938cc237f40bb | [
"MIT"
] | 3 | 2015-04-23T03:23:30.000Z | 2016-07-17T18:06:24.000Z | argue/helpers.py | kennethreitz-archive/argue | d936d63c16b8afcfabfcc1bcf41938cc237f40bb | [
"MIT"
] | null | null | null | argue/helpers.py | kennethreitz-archive/argue | d936d63c16b8afcfabfcc1bcf41938cc237f40bb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import inspect
import getopt
import traceback
write = sys.stdout.write
err = sys.stderr.write
def trim(docstring):
"""Intelligently undent given docstring."""
if not docstring:
return ''
# Convert tabs to spaces (following the normal Python rules)
# and split into a list of... | 28.489362 | 75 | 0.593976 | # -*- coding: utf-8 -*-
import sys
import inspect
import getopt
import traceback
from exceptions import *
write = sys.stdout.write
err = sys.stderr.write
def trim(docstring):
"""Intelligently undent given docstring."""
if not docstring:
return ''
# Convert tabs to spaces (following the normal Python rules)
... | 0 | 0 | 0 | 0 | 288 | 1,758 | 0 | 3 | 188 |
396a9a31bc1d1babea2e767718cab81c18022118 | 274 | py | Python | Part 2/Week_4_7/Exer 2 - Encontrando impares.py | Arielcarv/Intro-Ciencia-da-Computacao-USP | 03d69b9e0f3fa5fca053d0fc406aa1a584d33de1 | [
"MIT"
] | null | null | null | Part 2/Week_4_7/Exer 2 - Encontrando impares.py | Arielcarv/Intro-Ciencia-da-Computacao-USP | 03d69b9e0f3fa5fca053d0fc406aa1a584d33de1 | [
"MIT"
] | null | null | null | Part 2/Week_4_7/Exer 2 - Encontrando impares.py | Arielcarv/Intro-Ciencia-da-Computacao-USP | 03d69b9e0f3fa5fca053d0fc406aa1a584d33de1 | [
"MIT"
] | null | null | null | # a = [-10, -2, 0, 5, 66, 77, 99, 102, 239, 567, 875, 934]
# print(encontra_impares(a)) | 24.909091 | 58 | 0.587591 | # a = [-10, -2, 0, 5, 66, 77, 99, 102, 239, 567, 875, 934]
def encontra_impares(lista):
if not lista:
return[]
if lista[0] % 2 == 1:
return[lista[0]] + encontra_impares(lista[1:])
return encontra_impares(lista[1:])
# print(encontra_impares(a)) | 0 | 0 | 0 | 0 | 0 | 162 | 0 | 0 | 23 |
a4c99b84e9efe504cb9a3bd6dff93b11f1910fe2 | 954 | py | Python | snoop/management/commands/walkocr.py | hoover/snoop | bd49b081418a8a01a1e469ab17759a4c5b20d850 | [
"MIT"
] | 5 | 2017-01-03T00:52:03.000Z | 2019-10-27T03:32:35.000Z | snoop/management/commands/walkocr.py | hoover/snoop | bd49b081418a8a01a1e469ab17759a4c5b20d850 | [
"MIT"
] | 25 | 2016-08-21T11:26:44.000Z | 2018-03-13T12:19:20.000Z | snoop/management/commands/walkocr.py | hoover/snoop | bd49b081418a8a01a1e469ab17759a4c5b20d850 | [
"MIT"
] | 6 | 2016-09-27T13:03:45.000Z | 2019-10-27T03:32:30.000Z | from ... import models
| 30.774194 | 88 | 0.604822 | import sys
from django.core.management.base import BaseCommand
from ... import models
from ...ocr import walk
class Command(BaseCommand):
help = "Ingest OCRed files"
def add_arguments(self, parser):
parser.add_argument(
'collection_slug',
help="The slug of the collection"
... | 0 | 0 | 0 | 821 | 0 | 0 | 0 | 21 | 89 |
48d744dd4582baa4ff136fa30d44e02897214027 | 623 | py | Python | cot.py | RuanGOA/shellQuot | 255c66abd2df1b1b45ed9fdbd4b499c937be7ece | [
"MIT"
] | null | null | null | cot.py | RuanGOA/shellQuot | 255c66abd2df1b1b45ed9fdbd4b499c937be7ece | [
"MIT"
] | null | null | null | cot.py | RuanGOA/shellQuot | 255c66abd2df1b1b45ed9fdbd4b499c937be7ece | [
"MIT"
] | null | null | null | import requests as req
import sys
import json
request = req.get('https://economia.awesomeapi.com.br/json/all')
cotacoes = json.loads(request.text)
consultas = ["USD", "ARS", "EUR", "BTC"]
if(len(sys.argv) > 1):
consultas = sys.argv[1:]
print("1 BRL ==")
exibeCotacoes(consultas)
| 24.92 | 87 | 0.642055 | import requests as req
import sys
import json
request = req.get('https://economia.awesomeapi.com.br/json/all')
cotacoes = json.loads(request.text)
def exibeCotacoes(querys):
global cotacoes
keySet = cotacoes.keys()
for query in querys:
if(query in keySet):
preco = (float(cotacoes[query]['hig... | 0 | 0 | 0 | 0 | 0 | 315 | 0 | 0 | 23 |
5403d2690b90f53934ea0f73498e3f695dda07c9 | 3,461 | py | Python | src/api.py | UncleGoogle/galaxy-integration-osu | e18ce670bceb37dccff48c5bb70917dd205dffe8 | [
"MIT"
] | 15 | 2020-05-04T19:40:03.000Z | 2022-01-28T15:33:30.000Z | src/api.py | UncleGoogle/galaxy-integration-osu | e18ce670bceb37dccff48c5bb70917dd205dffe8 | [
"MIT"
] | 8 | 2020-05-02T20:14:42.000Z | 2022-01-17T11:16:31.000Z | src/api.py | UncleGoogle/galaxy-integration-osu | e18ce670bceb37dccff48c5bb70917dd205dffe8 | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
| 32.961905 | 94 | 0.639122 | import logging
import urllib
import json
import base64
import typing as t
from galaxy.http import create_client_session, handle_exception
from galaxy.api.errors import AccessDenied, AuthenticationRequired
logger = logging.getLogger(__name__)
class OAuthClient:
URL = 'https://unclegoogle.pythonanywhere.com/'
... | 0 | 236 | 1,505 | 1,403 | 0 | 0 | 0 | 58 | 202 |
fcc269c2c542432a45af1824239b195636264d11 | 158 | py | Python | work/apps.py | allink/allink-apps | 101a9e2e0129d932970e0ae89f790d2033a7c805 | [
"BSD-3-Clause"
] | 1 | 2017-03-13T08:49:49.000Z | 2017-03-13T08:49:49.000Z | work/apps.py | allink/allink-apps | 101a9e2e0129d932970e0ae89f790d2033a7c805 | [
"BSD-3-Clause"
] | null | null | null | work/apps.py | allink/allink-apps | 101a9e2e0129d932970e0ae89f790d2033a7c805 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
| 19.75 | 34 | 0.696203 | # -*- coding: utf-8 -*-
from django.apps import AppConfig
class AllinkWorkConfig(AppConfig):
name = 'allink_apps.work'
verbose_name = "Allink Work"
| 0 | 0 | 0 | 76 | 0 | 0 | 0 | 12 | 45 |
1ad1ba0261ce77b4901455f2ff9168f1076b225b | 2,669 | py | Python | Python/website/available.py | saneravi/ML_Stuff | 74e1ed7ba9f4dccb555792315a14ba6071150304 | [
"MIT"
] | 209 | 2015-01-02T03:47:12.000Z | 2022-03-06T16:54:47.000Z | Python/website/available.py | Kerwin-Xie/algorithms | 4347a9b7bf54ef378d16d26ef9e357ddc710664b | [
"MIT"
] | 3 | 2015-12-06T14:40:34.000Z | 2021-03-22T17:40:24.000Z | Python/website/available.py | Kerwin-Xie/algorithms | 4347a9b7bf54ef378d16d26ef9e357ddc710664b | [
"MIT"
] | 114 | 2015-01-31T08:37:10.000Z | 2022-02-23T04:42:28.000Z | import progressbar
import pythonwhois
def is_registered(site):
"""Check if a domain has an WHOIS record."""
try:
details = pythonwhois.get_whois(site)
except pythonwhois.shared.WhoisException as e:
print(f"Exception for {site}")
print(e)
return False
return not details[... | 25.663462 | 82 | 0.556763 | import progressbar
import pythonwhois
def is_registered(site):
"""Check if a domain has an WHOIS record."""
try:
details = pythonwhois.get_whois(site)
except pythonwhois.shared.WhoisException as e:
print(f"Exception for {site}")
print(e)
return False
return not details[... | 0 | 0 | 0 | 0 | 0 | 1,088 | 0 | 0 | 46 |
d48ffab9531a297072cbd4ff76bdd5719f069206 | 15,887 | py | Python | zoom/tools.py | JW709/zoom | 3b26a22e569bf44a9856b587771589413b52e81b | [
"MIT"
] | null | null | null | zoom/tools.py | JW709/zoom | 3b26a22e569bf44a9856b587771589413b52e81b | [
"MIT"
] | null | null | null | zoom/tools.py | JW709/zoom | 3b26a22e569bf44a9856b587771589413b52e81b | [
"MIT"
] | 1 | 2019-02-06T16:10:56.000Z | 2019-02-06T16:10:56.000Z | """
zoom.tools
"""
import datetime
import logging
import os
from markdown import Markdown
import zoom.helpers
from zoom.helpers import url_for_page
from zoom.utils import trim, dedup
from zoom.render import apply_helpers
one_day = datetime.timedelta(1)
one_week = one_day * 7
one_hour = datetime.timedelta(hours=1... | 26.087028 | 81 | 0.586454 | """
zoom.tools
"""
import datetime
import logging
import os
from markdown import Markdown
from zoom.response import RedirectResponse
import zoom.helpers
from zoom.helpers import abs_url_for, url_for_page, url_for
from zoom.utils import trim, dedup
from zoom.render import apply_helpers
one_day = datetime.timedelt... | 21 | 0 | 0 | 494 | 0 | 2,163 | 0 | 43 | 152 |
52f5ac4f40e2e21467d07470d5b4acddc43f73ab | 7,206 | py | Python | SlackBot.py | KeitHLeE94/Fresh_SSAFY | ba28b7f565798f87dd0635f646a088f6bcd92b8b | [
"MIT"
] | null | null | null | SlackBot.py | KeitHLeE94/Fresh_SSAFY | ba28b7f565798f87dd0635f646a088f6bcd92b8b | [
"MIT"
] | null | null | null | SlackBot.py | KeitHLeE94/Fresh_SSAFY | ba28b7f565798f87dd0635f646a088f6bcd92b8b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
from slackclient import SlackClient
from flask import Flask
#
app = Flask(__name__)
app.config['JSON_AS_ASCII'] = False
with open('SlackBotKey.json') as f:
slackKeys = json.load(f)
slack_token = slackKeys["slack_token"]
slack_client_id = slackKeys["slack_client_id"]
slack_cli... | 30.927039 | 120 | 0.620594 | # -*- coding: utf-8 -*-
import json
import os
import requests
import urllib.request
import time
import re
from bs4 import BeautifulSoup
from slackclient import SlackClient
from flask import Flask, request, make_response, render_template, jsonify
from selenium import webdriver
# 바꼈지롱
app = Flask(__name__)
app.config['... | 1,209 | 1,037 | 0 | 0 | 0 | 4,626 | 0 | 27 | 376 |
da9bb511136f1f7b075fc6f9636408c96b13d22e | 6,336 | py | Python | src/discolight/writers/annotation/coco.py | datature/discolight | ad29e75b472cf892a087d23cc9436f47f1b15441 | [
"MIT"
] | 27 | 2020-07-23T08:09:25.000Z | 2022-03-01T08:24:43.000Z | src/discolight/writers/annotation/coco.py | ghnreigns/discolight | 71ee176e0e58489867f21ddfcf8cce338631129c | [
"MIT"
] | 7 | 2020-08-05T07:26:55.000Z | 2020-12-31T04:20:40.000Z | src/discolight/writers/annotation/coco.py | ghnreigns/discolight | 71ee176e0e58489867f21ddfcf8cce338631129c | [
"MIT"
] | 6 | 2020-07-27T04:30:01.000Z | 2020-08-13T02:39:25.000Z | """A COCO annotation writer."""
| 30.171429 | 79 | 0.525568 | """A COCO annotation writer."""
import datetime
import json
from discolight.params.params import Params
from .types import AnnotationWriter
class COCO(AnnotationWriter):
"""A COCO annotation writer."""
def __init__(self, annotations_file):
"""Construct a COCO annotation writer."""
self.annot... | 0 | 239 | 0 | 5,933 | 0 | 0 | 0 | 20 | 111 |
a7680455f32028face2945d19acebab84b4be873 | 1,003 | py | Python | game/authentication/websocket_authentication.py | dimadk24/english-fight-api | 506a3eb2cb4cb91203b1e023b5248c27975df075 | [
"MIT"
] | null | null | null | game/authentication/websocket_authentication.py | dimadk24/english-fight-api | 506a3eb2cb4cb91203b1e023b5248c27975df075 | [
"MIT"
] | null | null | null | game/authentication/websocket_authentication.py | dimadk24/english-fight-api | 506a3eb2cb4cb91203b1e023b5248c27975df075 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.utils.module_loading import import_string
from rest_framework.exceptions import AuthenticationFailed
from game.authentication.base_websocket_authentication import (AbstractWebsocketAuthentication)
from game.models import AppUser
def authenticate_websocket(auth_header: str... | 35.821429 | 69 | 0.75673 | from django.conf import settings
from django.utils.module_loading import import_string
from rest_framework.exceptions import AuthenticationFailed
from game.authentication.base_websocket_authentication import (
AbstractWebsocketAuthentication,
)
from game.models import AppUser
def authenticate_websocket(auth_head... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 0 |
0b870a848cb319128582b27118ad6c272c59b5dd | 261 | py | Python | exercises/es/solution_03_03.py | mariacamilagl/spacy-course | de9fcdfcbc75e6a8864e49f2f75ab1536969cb70 | [
"MIT"
] | null | null | null | exercises/es/solution_03_03.py | mariacamilagl/spacy-course | de9fcdfcbc75e6a8864e49f2f75ab1536969cb70 | [
"MIT"
] | null | null | null | exercises/es/solution_03_03.py | mariacamilagl/spacy-course | de9fcdfcbc75e6a8864e49f2f75ab1536969cb70 | [
"MIT"
] | 1 | 2020-06-08T13:26:06.000Z | 2020-06-08T13:26:06.000Z | import spacy
# Carga el modelo en_core_web_sm
nlp = spacy.load("en_core_web_sm")
# Imprime en pantalla los nombres de los componentes del pipeline
print(nlp.pipe_names)
# Imprime en pantalla el pipeline entero de tuples (name, component)
print(nlp.pipeline)
| 23.727273 | 68 | 0.789272 | import spacy
# Carga el modelo en_core_web_sm
nlp = spacy.load("en_core_web_sm")
# Imprime en pantalla los nombres de los componentes del pipeline
print(nlp.pipe_names)
# Imprime en pantalla el pipeline entero de tuples (name, component)
print(nlp.pipeline)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7e3761c958322e5c09482795e65d3b825c49da18 | 8,390 | py | Python | catkin_ws/customgripper/class_program.py | DevwratJoshi/ur-o2as | 265249c27908a79a301014168394db0c0dc2204c | [
"MIT"
] | null | null | null | catkin_ws/customgripper/class_program.py | DevwratJoshi/ur-o2as | 265249c27908a79a301014168394db0c0dc2204c | [
"MIT"
] | null | null | null | catkin_ws/customgripper/class_program.py | DevwratJoshi/ur-o2as | 265249c27908a79a301014168394db0c0dc2204c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# import rospy
# from o2as_precision_gripper.srv import *
# if __name__ == "__main__":
#initialise the class here
gripper = PrecisionGripper()
# rospy.init_node("combined_gripper_server")
# # serial_port = rospy.get_param("serial_port")
# # rospy.loginfo("Starting up on serial port: " + serial_p... | 41.127451 | 116 | 0.612277 | #!/usr/bin/env python
import lib_robotis_xm430 as xm430
import sys
import time
# import rospy
# from o2as_precision_gripper.srv import *
class PrecisionGripper:
def __init__(self, serial_port = '/dev/ttyUSB0'):
self.dynamixel = xm430.USB2Dynamixel_Device( serial_port )
self.p1 = xm430.Robotis_Serv... | 0 | 0 | 0 | 7,812 | 0 | 0 | 0 | -9 | 90 |
6f16493308a79e424047abaee500b6e1f51f7a9e | 2,189 | py | Python | wageubn/function/activation.py | PannenetsF/wageubn | 8c93ae34123bb3576fd694f30cf3149cc4cc54eb | [
"BSD-3-Clause"
] | 4 | 2021-03-17T06:01:47.000Z | 2022-02-23T07:32:19.000Z | wageubn/function/activation.py | PannenetsF/wageubn | 8c93ae34123bb3576fd694f30cf3149cc4cc54eb | [
"BSD-3-Clause"
] | null | null | null | wageubn/function/activation.py | PannenetsF/wageubn | 8c93ae34123bb3576fd694f30cf3149cc4cc54eb | [
"BSD-3-Clause"
] | null | null | null | """
Provide quantilized form of torch.nn.modules.activation
"""
import torch.nn as nn
| 34.203125 | 69 | 0.627227 | """
Provide quantilized form of torch.nn.modules.activation
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from .number import directquant, alldirectquant
class ReLU(nn.ReLU):
def __init__(self,
inplace=False,
input_dec_bit_width=8,
acti... | 0 | 0 | 0 | 1,960 | 0 | 0 | 0 | 27 | 114 |
a24ec8652a0b3581cf0c1785150274515c4cea3f | 3,815 | py | Python | Cura/libCharon/Charon/Service/FileService.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | Cura/libCharon/Charon/Service/FileService.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | Cura/libCharon/Charon/Service/FileService.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | import logging
log = logging.getLogger(__name__)
## The main interface for the Charon file service.
#
# This contains the main interface definition for the Charon file service.
# It is exposed over DBus as the "nl.ultimaker.charon" service, with
# "/nl/ultimaker/charon" as its object path and all functions reg... | 42.388889 | 135 | 0.690695 | import dbus
import logging
import RequestQueue
log = logging.getLogger(__name__)
## The main interface for the Charon file service.
#
# This contains the main interface definition for the Charon file service.
# It is exposed over DBus as the "nl.ultimaker.charon" service, with
# "/nl/ultimaker/charon" as its ... | 0 | 888 | 0 | 2,233 | 0 | 0 | 0 | -12 | 67 |
a269ce3c583ec8df9ab3fc850326151bbfe83c8b | 1,401 | py | Python | Distance/calculateDistance.py | matheuscr30/Clustering-Algorithms | 17013588e33e39c98885df29a0d52b62268515ce | [
"MIT"
] | null | null | null | Distance/calculateDistance.py | matheuscr30/Clustering-Algorithms | 17013588e33e39c98885df29a0d52b62268515ce | [
"MIT"
] | 11 | 2020-01-28T22:59:24.000Z | 2022-03-11T23:59:04.000Z | Distance/calculateDistance.py | matheuscr30/Clustering-Algorithms | 17013588e33e39c98885df29a0d52b62268515ce | [
"MIT"
] | null | null | null | from HelpersCsv import ParseCsv, WriteCsv
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--path', '-p', help="path of input data", type=str)
parser.add_argument('--hasheaders', '-hh', help="if file has headers", type=int, default=0)
parser.add_argument('--distance', '-d', help="pass 1 for manh... | 28.591837 | 98 | 0.598144 | from HelpersCsv import ParseCsv, WriteCsv
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument('--path', '-p', help="path of input data", type=str)
parser.add_argument('--hasheaders', '-hh', help="if file has headers", type=int, default=0)
parser.add_argument('--distance', '-d', help="pass... | 0 | 0 | 0 | 0 | 0 | 726 | 0 | -11 | 45 |
28f5cd219b732f555d9e3a70395463b9af0a9535 | 643 | py | Python | contrib/vcl/source/vcl_build_launcher.py | giantcroc/envoy | c535d5abf8d106925070fe6fd018a716e6bf2bf1 | [
"Apache-2.0"
] | 17,703 | 2017-09-14T18:23:43.000Z | 2022-03-31T22:04:17.000Z | contrib/vcl/source/vcl_build_launcher.py | giantcroc/envoy | c535d5abf8d106925070fe6fd018a716e6bf2bf1 | [
"Apache-2.0"
] | 15,957 | 2017-09-14T16:38:22.000Z | 2022-03-31T23:56:30.000Z | contrib/vcl/source/vcl_build_launcher.py | giantcroc/envoy | c535d5abf8d106925070fe6fd018a716e6bf2bf1 | [
"Apache-2.0"
] | 3,780 | 2017-09-14T18:58:47.000Z | 2022-03-31T17:10:47.000Z | #!/usr/bin/python
# Launcher for building vcl
import os
import subprocess
import sys
def main():
""" VCL builder script """
# find path to helper script
script_path = os.path.dirname(os.path.abspath(sys.argv[0]))
vcl_build = f"{script_path}/{sys.argv[1]}"
# find path to vpp/vcl source code
... | 21.433333 | 63 | 0.673406 | #!/usr/bin/python
# Launcher for building vcl
import os
import subprocess
import sys
def main():
""" VCL builder script """
# find path to helper script
script_path = os.path.dirname(os.path.abspath(sys.argv[0]))
vcl_build = f"{script_path}/{sys.argv[1]}"
# find path to vpp/vcl source code
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3870853e2cf8a048e8ca46bb1ffa724b2ca8a3f6 | 729 | py | Python | tests/integration/files/lj/lj.py | yjw0510/freud | b47b36d9afacc0833febfd51755b0e94664c0c07 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/files/lj/lj.py | yjw0510/freud | b47b36d9afacc0833febfd51755b0e94664c0c07 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/files/lj/lj.py | yjw0510/freud | b47b36d9afacc0833febfd51755b0e94664c0c07 | [
"BSD-3-Clause"
] | null | null | null | import hoomd
from hoomd import md
hoomd.context.initialize()
# Create a 10x10x10 simple cubic lattice of particles with type name A
hoomd.init.create_lattice(
unitcell=hoomd.lattice.sc(a=2.0, type_name='A'), n=10)
# Specify Lennard-Jones interactions between particle pairs
nl = md.nlist.cell()
lj = md.pair.lj(r_c... | 29.16 | 78 | 0.743484 | import hoomd
from hoomd import md
hoomd.context.initialize()
# Create a 10x10x10 simple cubic lattice of particles with type name A
hoomd.init.create_lattice(
unitcell=hoomd.lattice.sc(a=2.0, type_name='A'), n=10)
# Specify Lennard-Jones interactions between particle pairs
nl = md.nlist.cell()
lj = md.pair.lj(r_c... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
96f37025bb6115272c07aaf8d5502fc19e7d99d4 | 3,646 | py | Python | src/edubot/snapext/joystick/__init__.py | wendlers/edubot-snap | 09c471ef8738a3fc2aae6772a1e02ef8e15d5737 | [
"MIT"
] | null | null | null | src/edubot/snapext/joystick/__init__.py | wendlers/edubot-snap | 09c471ef8738a3fc2aae6772a1e02ef8e15d5737 | [
"MIT"
] | null | null | null | src/edubot/snapext/joystick/__init__.py | wendlers/edubot-snap | 09c471ef8738a3fc2aae6772a1e02ef8e15d5737 | [
"MIT"
] | null | null | null | ##
# The MIT License (MIT)
#
# Copyright (c) 2016 Stefan Wendler
#
# 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,... | 29.403226 | 121 | 0.614372 | ##
# The MIT License (MIT)
#
# Copyright (c) 2016 Stefan Wendler
#
# 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,... | 0 | 914 | 0 | 1,315 | 0 | 0 | 0 | 90 | 159 |
34a001a3242359b21afd92117d6b13c8f44f5df2 | 1,155 | py | Python | km_api/know_me/profile/tests/models/test_model_functions.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 4 | 2017-08-03T00:46:31.000Z | 2018-11-06T03:32:32.000Z | km_api/know_me/profile/tests/models/test_model_functions.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 526 | 2017-06-27T18:13:59.000Z | 2021-06-10T18:00:21.000Z | km_api/know_me/profile/tests/models/test_model_functions.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 1 | 2017-07-10T19:46:27.000Z | 2017-07-10T19:46:27.000Z | from unittest import mock
from know_me.profile import models
def test_get_media_resource_upload_path():
"""
Media Resources should be stored with their original filename in a
folder titled ``know-me/users/{id}/media-resources``.
"""
resource = mock.Mock(name="Mock Media Resource")
resource.km... | 30.394737 | 78 | 0.706494 | from unittest import mock
from know_me.profile import models
def test_get_media_resource_upload_path():
"""
Media Resources should be stored with their original filename in a
folder titled ``know-me/users/{id}/media-resources``.
"""
resource = mock.Mock(name="Mock Media Resource")
resource.km... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4973c6f101c4ca80c4de1565af88105586bd7d3d | 231 | py | Python | twkit/curation/__init__.py | evaperon/twAwler | 8e9f2064cad846177ed6547b9f56f053226a2d5e | [
"Apache-2.0"
] | 5 | 2018-12-06T16:14:14.000Z | 2020-05-22T07:36:45.000Z | twkit/curation/__init__.py | evaperon/twAwler | 8e9f2064cad846177ed6547b9f56f053226a2d5e | [
"Apache-2.0"
] | null | null | null | twkit/curation/__init__.py | evaperon/twAwler | 8e9f2064cad846177ed6547b9f56f053226a2d5e | [
"Apache-2.0"
] | 3 | 2020-04-20T07:20:18.000Z | 2021-08-19T17:31:38.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###########################################
# (c) 2016-2020 Polyvios Pratikakis
# polyvios@ics.forth.gr
###########################################
#__all__ = ['utils']
''' empty '''
| 23.1 | 43 | 0.380952 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###########################################
# (c) 2016-2020 Polyvios Pratikakis
# polyvios@ics.forth.gr
###########################################
#__all__ = ['utils']
''' empty '''
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7983fe40ed15838a7b1f9ef89f8b2677b9927e6f | 1,470 | py | Python | day003/list2.py | marcosvbras/60-days-of-python | b6966192a8e9113dd13491ab8707c2b547397eea | [
"Apache-2.0"
] | 5 | 2018-04-07T02:45:04.000Z | 2022-03-29T02:52:03.000Z | day003/list2.py | marcosvbras/60-days-of-python | b6966192a8e9113dd13491ab8707c2b547397eea | [
"Apache-2.0"
] | null | null | null | day003/list2.py | marcosvbras/60-days-of-python | b6966192a8e9113dd13491ab8707c2b547397eea | [
"Apache-2.0"
] | 5 | 2019-05-10T03:12:17.000Z | 2021-01-16T10:54:41.000Z | # coding=utf-8
"""List II - In-place functions: Reverse, Sort and Extend.
Examples with in-place list functions. In-place functions changes
the original object and return None after calling it.
"""
def do_something_magical(animes, tvshows):
"""Use some list methods."""
animes.reverse()
print("Inv... | 45.9375 | 168 | 0.670068 | # coding=utf-8
"""List II - In-place functions: Reverse, Sort and Extend.
Examples with in-place list functions. In-place functions changes
the original object and return None after calling it.
"""
def do_something_magical(animes, tvshows):
"""Use some list methods."""
animes.reverse()
print("Inv... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
407a2686af14eded1db450d38619ff5ecf832898 | 1,384 | py | Python | examples/rtp_freespace_density.py | zpeng2/ald | 040ce6176998a9ca024eb9f420e8c6c63ca6af81 | [
"MIT"
] | null | null | null | examples/rtp_freespace_density.py | zpeng2/ald | 040ce6176998a9ca024eb9f420e8c6c63ca6af81 | [
"MIT"
] | 1 | 2020-11-29T06:46:22.000Z | 2020-11-29T06:46:22.000Z | examples/rtp_freespace_density.py | zpeng2/ald | 040ce6176998a9ca024eb9f420e8c6c63ca6af81 | [
"MIT"
] | null | null | null | import ald
import numpy as np
U0 = 1.0
tauR = 1.2
alpha = 1.2
particle = ald.Pareto(U0=U0, tauR=tauR, alpha=alpha)
flow = ald.ZeroVelocity()
domain = ald.Box()
ic = ald.InitialConfig(
x=ald.Uniform(domain.left, domain.right),
y=ald.Uniform(domain.left, domain.right),
theta=ald.Uniform(0, 2 * np.pi),
)
... | 23.862069 | 77 | 0.699422 | import ald
import numpy as np
import h5py
U0 = 1.0
tauR = 1.2
alpha = 1.2
particle = ald.Pareto(U0=U0, tauR=tauR, alpha=alpha)
flow = ald.ZeroVelocity()
domain = ald.Box()
ic = ald.InitialConfig(
x=ald.Uniform(domain.left, domain.right),
y=ald.Uniform(domain.left, domain.right),
theta=ald.Uniform(0, 2 *... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
e4e71f3f61b4c80f350c140b3136ab566c030b2e | 1,541 | py | Python | angka_detik.py | suaraksara/Berita-Angka | 0a2f48019b521a2d920859087e957986a18c76d8 | [
"MIT"
] | null | null | null | angka_detik.py | suaraksara/Berita-Angka | 0a2f48019b521a2d920859087e957986a18c76d8 | [
"MIT"
] | null | null | null | angka_detik.py | suaraksara/Berita-Angka | 0a2f48019b521a2d920859087e957986a18c76d8 | [
"MIT"
] | null | null | null | #Skrip alfa
from requests import get
from bs4 import BeautifulSoup as bs
import pandas as pd
hari = input('Tanggal? (dua digit): \n')
bulan = input('Bulan? (dua digit): \n')
tahun = input('Tahun? (empat digit): \n')
x = bulan+'/'+hari+'/'+tahun
halaman_detik = [str(i) for i in range(1, 21)]
#https://news.detik.com/... | 26.568966 | 69 | 0.647631 | #Skrip alfa
from requests import get
from bs4 import BeautifulSoup as bs
import pandas as pd
hari = input('Tanggal? (dua digit): \n')
bulan = input('Bulan? (dua digit): \n')
tahun = input('Tahun? (empat digit): \n')
x = bulan+'/'+hari+'/'+tahun
halaman_detik = [str(i) for i in range(1, 21)]
def ada_angka(kalimat):
... | 0 | 0 | 0 | 0 | 0 | 53 | 0 | 0 | 23 |
686bbd1aa6cd86e123b351d54c8d59fff5e3faee | 992 | py | Python | toscaparser/tests/data/CSAR/tosca_elk/Python/collectd/config.py | mikidep/tosca-parser | 6cef1dfc712165c4d75aeae36f6bd4758fcfff5c | [
"Apache-2.0"
] | 99 | 2015-09-02T23:07:47.000Z | 2022-02-02T14:13:07.000Z | toscaparser/tests/data/CSAR/tosca_elk/Python/collectd/config.py | mikidep/tosca-parser | 6cef1dfc712165c4d75aeae36f6bd4758fcfff5c | [
"Apache-2.0"
] | 26 | 2019-09-09T04:45:17.000Z | 2021-06-25T15:23:52.000Z | toscaparser/tests/data/CSAR/tosca_elk/Python/collectd/config.py | mikidep/tosca-parser | 6cef1dfc712165c4d75aeae36f6bd4758fcfff5c | [
"Apache-2.0"
] | 59 | 2015-10-28T09:14:01.000Z | 2022-02-13T13:54:24.000Z | #!/usr/bin/python
# 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 writi... | 38.153846 | 78 | 0.690524 | #!/usr/bin/python
# 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 writi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
63b9af183e4686b893f0f1a3877ba6fec57f8845 | 3,701 | py | Python | universum/__main__.py | Soheil-Momeni/Universum | 9138957350e35954578254bce49400c7bb9ee525 | [
"BSD-2-Clause"
] | null | null | null | universum/__main__.py | Soheil-Momeni/Universum | 9138957350e35954578254bce49400c7bb9ee525 | [
"BSD-2-Clause"
] | null | null | null | universum/__main__.py | Soheil-Momeni/Universum | 9138957350e35954578254bce49400c7bb9ee525 | [
"BSD-2-Clause"
] | 1 | 2020-12-23T15:14:32.000Z | 2020-12-23T15:14:32.000Z | import sys
if __name__ == "__main__":
exit_code = main()
sys.exit(exit_code)
| 36.643564 | 111 | 0.7117 | from typing import List, Optional
import signal
import sys
from . import __version__, __title__
from .api import Api
from .github_handler import GithubHandler
from .config_creator import ConfigCreator
from .lib.ci_exception import SilentAbortException
from .lib.gravity import define_arguments_recursive, construct_comp... | 0 | 0 | 0 | 0 | 0 | 2,925 | 0 | 286 | 400 |
ec82761d9e71081eae21c17c0d1324246c78aaf2 | 3,291 | py | Python | apps/user_operation/serializers.py | GITliyanfeng/vue-djang-shop | a49d75eb74914deffcff6cf594d416d284e64b01 | [
"MIT"
] | 1 | 2020-03-25T13:48:55.000Z | 2020-03-25T13:48:55.000Z | apps/user_operation/serializers.py | GITliyanfeng/vue-djang-shop | a49d75eb74914deffcff6cf594d416d284e64b01 | [
"MIT"
] | 8 | 2020-06-05T20:07:10.000Z | 2022-03-11T23:42:18.000Z | apps/user_operation/serializers.py | GITliyanfeng/vue-djang-shop | a49d75eb74914deffcff6cf594d416d284e64b01 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# __author__ : py_lee
# __time__ : '18-12-14 2:54'
| 32.584158 | 120 | 0.673048 | # -*- coding: utf-8 -*-
# __author__ : py_lee
# __time__ : '18-12-14 下午2:54'
import re
from rest_framework import serializers
from rest_framework.validators import UniqueTogetherValidator
from user_operation.models import UserFav, UserLeavingMessage, UserAddress
from goods.serializer import UserFavGoodsSerializers
f... | 786 | 0 | 0 | 2,570 | 0 | 0 | 0 | 153 | 225 |
2163afdbd31907c387d52ba41b87c4a42c3e1b53 | 1,009 | py | Python | tree_guardian/constants.py | fadich/tree-guardian | 5214c0474834fca0b12ff43fc55de3960da59d8d | [
"MIT"
] | 1 | 2019-08-22T14:00:45.000Z | 2019-08-22T14:00:45.000Z | tree_guardian/constants.py | fadich/tree-guardian | 5214c0474834fca0b12ff43fc55de3960da59d8d | [
"MIT"
] | 3 | 2019-08-29T11:21:38.000Z | 2021-09-18T18:24:04.000Z | tree_guardian/constants.py | fadich/tree-guardian | 5214c0474834fca0b12ff43fc55de3960da59d8d | [
"MIT"
] | null | null | null | from .utils import get_gitignored
EXCLUDE_DOC = {'*.md', '*.doc', '*.docx', '*.txt', '*.pdf', }
EXCLUDE_CONFIG = {'*.cfg', '*.ini', '*.conf', }
EXCLUDE_YAML = {'*.yml', '*.yaml', }
EXCLUDE_BASH = {'*.sh', }
EXCLUDE_GIT = {'.git', '.gitignore', }
EXCLUDE_DOCKER = {'Dockerfile', '.dockerignore', }
EXCLUDE_VIRTUALENV ... | 36.035714 | 100 | 0.667988 | from .utils import get_gitignored
EXCLUDE_DOC = {'*.md', '*.doc', '*.docx', '*.txt', '*.pdf', }
EXCLUDE_CONFIG = {'*.cfg', '*.ini', '*.conf', }
EXCLUDE_YAML = {'*.yml', '*.yaml', }
EXCLUDE_BASH = {'*.sh', }
EXCLUDE_GIT = {'.git', '.gitignore', }
EXCLUDE_DOCKER = {'Dockerfile', '.dockerignore', }
EXCLUDE_VIRTUALENV ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
16f2cca1071a6fc3da199ef9f69b971a532d7653 | 376 | py | Python | lists_manip.py | eqperes/useful_functions | 687a80de9694ca5f12ff26500288d01386b65280 | [
"MIT"
] | null | null | null | lists_manip.py | eqperes/useful_functions | 687a80de9694ca5f12ff26500288d01386b65280 | [
"MIT"
] | null | null | null | lists_manip.py | eqperes/useful_functions | 687a80de9694ca5f12ff26500288d01386b65280 | [
"MIT"
] | null | null | null |
#Source: http://code.activestate.com/recipes/578948-flattening-an-arbitrarily-nested-list-in-python/
def flatten(lis):
"""Given a list, possibly nested to any level, return it flattened."""
new_lis = []
for item in lis:
if type(item) == type([]):
new_lis.extend(flatten(item))
el... | 31.333333 | 100 | 0.630319 |
#Source: http://code.activestate.com/recipes/578948-flattening-an-arbitrarily-nested-list-in-python/
def flatten(lis):
"""Given a list, possibly nested to any level, return it flattened."""
new_lis = []
for item in lis:
if type(item) == type([]):
new_lis.extend(flatten(item))
el... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bda034eb5d300bef8169ef8f0b6f9cf24b0b4798 | 904 | py | Python | WebClassApp/categorias/urls.py | jesuscol96/WebClassApp | 092bde4cb16f09f3efafc32af904715fae59773a | [
"MIT"
] | null | null | null | WebClassApp/categorias/urls.py | jesuscol96/WebClassApp | 092bde4cb16f09f3efafc32af904715fae59773a | [
"MIT"
] | null | null | null | WebClassApp/categorias/urls.py | jesuscol96/WebClassApp | 092bde4cb16f09f3efafc32af904715fae59773a | [
"MIT"
] | null | null | null | from django.urls import path, re_path
from . import views
app_name = 'categorias'
urlpatterns = [
path('', views.index, name='index'),
path('crear_categoria', views.crear_categoria, name='crear_categoria'),
path('process_new_categories', views.process_new_categories, name='process_new_categories'),
... | 53.176471 | 121 | 0.754425 | from django.urls import path, re_path
from . import views
app_name = 'categorias'
urlpatterns = [
path('', views.index, name='index'),
path('crear_categoria', views.crear_categoria, name='crear_categoria'),
path('process_new_categories', views.process_new_categories, name='process_new_categories'),
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b27a4485a770360ca4a813e6c1578ef01d9361f8 | 4,874 | py | Python | revscoring/revscoring/datasources/meta/selectors.py | yafeunteun/wikipedia-spam-classifier | fca782b39b287fbc0b2dd54f8e2bf33c6d3bc519 | [
"MIT"
] | 2 | 2016-10-26T18:58:53.000Z | 2017-06-22T20:11:20.000Z | revscoring/revscoring/datasources/meta/selectors.py | yafeunteun/wikipedia-spam-classifier | fca782b39b287fbc0b2dd54f8e2bf33c6d3bc519 | [
"MIT"
] | null | null | null | revscoring/revscoring/datasources/meta/selectors.py | yafeunteun/wikipedia-spam-classifier | fca782b39b287fbc0b2dd54f8e2bf33c6d3bc519 | [
"MIT"
] | null | null | null | """
These meta-datasources operate on :class:`revscoring.Datasource`'s that return
a flat `dict` of key-value pairs (aka a "table") and filter ("select") keys
and/or weight values.
.. autoclass:: revscoring.datasources.meta.selectors.tfidf
.. autoclass:: revscoring.datasources.meta.selectors.filter_keys
"""
| 35.064748 | 78 | 0.595404 | """
These meta-datasources operate on :class:`revscoring.Datasource`'s that return
a flat `dict` of key-value pairs (aka a "table") and filter ("select") keys
and/or weight values.
.. autoclass:: revscoring.datasources.meta.selectors.tfidf
.. autoclass:: revscoring.datasources.meta.selectors.filter_keys
"""
from co... | 0 | 0 | 0 | 4,169 | 0 | 226 | 0 | 27 | 137 |
46d1d0a30e460a326b014b2e36972c9af117564a | 1,864 | py | Python | screenbreak/work.py | gythaogg/screenbreak | 590c057006ab2dc6f1c2b1ff962f7b2d9d8fe552 | [
"MIT"
] | null | null | null | screenbreak/work.py | gythaogg/screenbreak | 590c057006ab2dc6f1c2b1ff962f7b2d9d8fe552 | [
"MIT"
] | null | null | null | screenbreak/work.py | gythaogg/screenbreak | 590c057006ab2dc6f1c2b1ff962f7b2d9d8fe552 | [
"MIT"
] | null | null | null | import logging
if __name__ == '__main__':
logging.basicConfig(format='%(asctime)s: %(message)s', level=logging.INFO)
main()
| 25.534247 | 78 | 0.616953 | import argparse
import logging
import os
import time
from .helper import notify
from .state import QuitNow, TimedState
class Work(TimedState):
def __init__(self, interval_mins=25, message='Work away!'):
super().__init__(interval_mins, message, 'break')
return
class Relax(TimedState):
def __... | 0 | 0 | 0 | 548 | 0 | 981 | 0 | -6 | 203 |
f8ba945f970cea6b4599c851e3229fa6f5df95e4 | 1,673 | py | Python | main.py | GZR1996/dcgan_comic | c1ece84cd8768e2834b8b106a0933819d1e45203 | [
"Apache-2.0"
] | null | null | null | main.py | GZR1996/dcgan_comic | c1ece84cd8768e2834b8b106a0933819d1e45203 | [
"Apache-2.0"
] | null | null | null | main.py | GZR1996/dcgan_comic | c1ece84cd8768e2834b8b106a0933819d1e45203 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import tensorflow as tf
flags = tf.app.flags
flags.DEFINE_integer("epoch", 25, "Epoch to train [25]")
flags.DEFINE_float("learning_rate", 0.0002, "Learning rate of for adam [0.0002]")
flags.DEFINE_float("beta1", 0.5, "Momentum term of adam [0.5]")
flags.DEFINE_integer("train_size", np.inf, "The siz... | 61.962963 | 138 | 0.754334 | import os
import scipy.misc #
import numpy as np
from model import DCGAN
from utils import pp, visualize, to_json, show_all_variables
import tensorflow as tf
flags = tf.app.flags
flags.DEFINE_integer("epoch", 25, "Epoch to train [25]")
flags.DEFINE_float("learning_rate", 0.0002, "Learning rate of for adam [0.0002]")... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 | 91 |
be1f856e35211d4ca42bec9dbe6ee0b7471ddcf5 | 423 | py | Python | mmdet3d/models/roi_heads/__init__.py | BOURSa/mmdetection3d | 27d0001e873b3102a828a27e1372873fcf81ed7e | [
"Apache-2.0"
] | 12 | 2021-03-17T09:07:18.000Z | 2022-01-21T01:37:42.000Z | mmdet3d/models/roi_heads/__init__.py | BOURSa/mmdetection3d | 27d0001e873b3102a828a27e1372873fcf81ed7e | [
"Apache-2.0"
] | 1 | 2020-08-11T05:44:29.000Z | 2020-08-11T05:44:29.000Z | mmdet3d/models/roi_heads/__init__.py | BOURSa/mmdetection3d | 27d0001e873b3102a828a27e1372873fcf81ed7e | [
"Apache-2.0"
] | 2 | 2021-03-17T09:25:15.000Z | 2021-04-22T09:15:58.000Z | from .base_3droi_head import Base3DRoIHead
from .bbox_heads import PartA2BboxHead
from .mask_heads import PointwiseSemanticHead
from .part_aggregation_roi_head import PartAggregationROIHead
from .roi_extractors import Single3DRoIAwareExtractor, SingleRoIExtractor
__all__ = [
'Base3DRoIHead', 'PartAggregationROIHea... | 38.454545 | 73 | 0.843972 | from .base_3droi_head import Base3DRoIHead
from .bbox_heads import PartA2BboxHead
from .mask_heads import PointwiseSemanticHead
from .part_aggregation_roi_head import PartAggregationROIHead
from .roi_extractors import Single3DRoIAwareExtractor, SingleRoIExtractor
__all__ = [
'Base3DRoIHead', 'PartAggregationROIHea... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9b3d05d66f38b67ad7eff1a9e113c8ce78b1a9b4 | 5,254 | py | Python | lib/processors/loop.py | webyaml/core | 3820c61c24624375e2d993c2817b6ff3cadb9960 | [
"Apache-2.0"
] | 10 | 2018-05-05T17:11:08.000Z | 2022-02-09T20:28:11.000Z | lib/processors/loop.py | webyaml/core | 3820c61c24624375e2d993c2817b6ff3cadb9960 | [
"Apache-2.0"
] | 6 | 2018-05-07T20:15:31.000Z | 2018-09-27T23:27:26.000Z | lib/processors/loop.py | webyaml/core | 3820c61c24624375e2d993c2817b6ff3cadb9960 | [
"Apache-2.0"
] | 1 | 2021-08-09T04:21:56.000Z | 2021-08-09T04:21:56.000Z | # path: lib/processors
# filename: loop.py
# description: WSGI application image file processors
'''
# make python2 strings and dictionaries behave like python3
from __future__ import unicode_literals
try:
from builtins import dict, str
except ImportError:
from __builtin__ import dict, str
Copyright 2017 Mark M... | 22.262712 | 88 | 0.627903 | # path: lib/processors
# filename: loop.py
# description: WSGI application image file processors
'''
# make python2 strings and dictionaries behave like python3
from __future__ import unicode_literals
try:
from builtins import dict, str
except ImportError:
from __builtin__ import dict, str
Copyright 2017 Mark M... | 0 | 0 | 0 | 4,267 | 0 | 0 | 0 | -7 | 66 |
73ee26c7912f333d89891f30cf9566f326b22daa | 3,799 | py | Python | sentiment-topic-keyword-server/Topics/Seeds22/labeledCluster.py | SubhasisDutta/Testanalyzer | 9a338644bdd342ff22a99a7d689f0ba228041398 | [
"Apache-2.0"
] | 3 | 2017-09-06T03:17:00.000Z | 2020-08-16T05:06:11.000Z | sentiment-topic-keyword-server/Topics/Seeds22/labeledCluster.py | SubhasisDutta/text-analysis | 9a338644bdd342ff22a99a7d689f0ba228041398 | [
"Apache-2.0"
] | null | null | null | sentiment-topic-keyword-server/Topics/Seeds22/labeledCluster.py | SubhasisDutta/text-analysis | 9a338644bdd342ff22a99a7d689f0ba228041398 | [
"Apache-2.0"
] | null | null | null | '''
Copyright 2015 Serendio Inc.
Author - Satish Palaniappan
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 ... | 26.020548 | 168 | 0.715715 | '''
Copyright 2015 Serendio Inc.
Author - Satish Palaniappan
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 ... | 0 | 0 | 0 | 0 | 0 | 158 | 0 | -1 | 112 |
c5c28c66534a3487f6d9e1a8a954addf9aa66fd9 | 2,749 | py | Python | agents/enjoy_pybullet_humanoid.py | nnaisense/pgpelib | d00907fe4b237e875ac0cc5b9d9c22591e4a7206 | [
"BSD-3-Clause"
] | 36 | 2021-02-26T22:54:14.000Z | 2022-03-20T12:59:48.000Z | agents/enjoy_pybullet_humanoid.py | nnaisense/pgpelib | d00907fe4b237e875ac0cc5b9d9c22591e4a7206 | [
"BSD-3-Clause"
] | null | null | null | agents/enjoy_pybullet_humanoid.py | nnaisense/pgpelib | d00907fe4b237e875ac0cc5b9d9c22591e4a7206 | [
"BSD-3-Clause"
] | 3 | 2021-03-17T13:44:28.000Z | 2022-01-11T11:15:23.000Z | import sys
if __name__ == "__main__":
main(*(sys.argv[1:]))
| 31.965116 | 89 | 0.639869 | from pgpelib.restore import to_torch_module
from typing import List, Optional
import sys
import torch
from torch import nn
import numpy as np
import gym
import pybullet_envs
from time import sleep
from copy import deepcopy
def evaluate_artifact(artifact_name: str,
ntimes: int,
... | 0 | 0 | 0 | 0 | 0 | 2,422 | 0 | 14 | 244 |
82c3d5fb9cca3bca73607668c563158ceae9a3a8 | 9,352 | py | Python | src/ast_toolbox/mcts/AdaptiveStressTesting.py | hdelecki/AdaptiveStressTestingToolbox | 184d7d7f1b4acb65eecb749e3c3a78cbcfc3c4ed | [
"MIT"
] | 29 | 2019-01-09T23:56:35.000Z | 2022-03-18T03:41:10.000Z | src/ast_toolbox/mcts/AdaptiveStressTesting.py | hdelecki/AdaptiveStressTestingToolbox | 184d7d7f1b4acb65eecb749e3c3a78cbcfc3c4ed | [
"MIT"
] | 39 | 2019-01-10T00:32:26.000Z | 2022-03-12T00:29:05.000Z | src/ast_toolbox/mcts/AdaptiveStressTesting.py | hdelecki/AdaptiveStressTestingToolbox | 184d7d7f1b4acb65eecb749e3c3a78cbcfc3c4ed | [
"MIT"
] | 11 | 2019-01-10T08:11:47.000Z | 2021-12-28T15:56:02.000Z | # import garage.misc.logger as logger
import ast_toolbox.mcts.MDP as MDP
def get_action_sequence(s):
"""Get the action sequence that leads to the state.
Parameters
----------
s : :py:class:`ast_toolbox.mcts.AdaptiveStressTesting.ASTState`
The target state.
Returns
----------
... | 28.687117 | 117 | 0.555389 | import pickle
import numpy as np
# import garage.misc.logger as logger
from dowel import logger
from dowel import tabular
import ast_toolbox.mcts.MDP as MDP
class ASTParams:
"""Structure that stores internal parameters for AST.
Parameters
----------
max_steps : int, optional
The maximum sea... | 0 | 0 | 0 | 8,551 | 0 | 0 | 0 | -4 | 181 |
c5a8d70376532f910b377ec61798a97086f04a5a | 20,658 | py | Python | LocastService.py | thor0215/locast2plex | 2b6291a11269bbee71bf0ef2799c9e97f47c60e5 | [
"MIT"
] | null | null | null | LocastService.py | thor0215/locast2plex | 2b6291a11269bbee71bf0ef2799c9e97f47c60e5 | [
"MIT"
] | null | null | null | LocastService.py | thor0215/locast2plex | 2b6291a11269bbee71bf0ef2799c9e97f47c60e5 | [
"MIT"
] | null | null | null | # pylama:ignore=E722,E303
import urllib.error
import urllib.parse
| 40.112621 | 127 | 0.568012 | # pylama:ignore=E722,E303
import json
import sys
import re
from functools import update_wrapper
from datetime import datetime
import urllib.error
import urllib.parse
import urllib.request
import time
import m3u8
def handle_url_except(f):
def wrapper_func(self, *args, **kwargs):
try:
return ... | 0 | 5,747 | 0 | 14,028 | 0 | 620 | 0 | -30 | 223 |
f7d5d0d815567820b2c2e14ac9cf6e32b2ac9b20 | 14,635 | py | Python | tensorflow_model_analysis/addons/fairness/metrics/fairness_indicators_test.py | jay90099/model-analysis | 4389611ae476686d349bd6d16de39855d491cf0c | [
"Apache-2.0"
] | null | null | null | tensorflow_model_analysis/addons/fairness/metrics/fairness_indicators_test.py | jay90099/model-analysis | 4389611ae476686d349bd6d16de39855d491cf0c | [
"Apache-2.0"
] | null | null | null | tensorflow_model_analysis/addons/fairness/metrics/fairness_indicators_test.py | jay90099/model-analysis | 4389611ae476686d349bd6d16de39855d491cf0c | [
"Apache-2.0"
] | null | null | null | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 38.311518 | 81 | 0.584011 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 0 | 6,743 | 0 | 6,573 | 0 | 0 | 0 | 199 | 222 |
76d65fde47c18a826293663ac7c0b87d1b2ce9be | 936 | py | Python | events/key_event.py | gbkim000/wxPython | b1604d71cf04801f9efa8b26b935561a88ef1daa | [
"BSD-2-Clause"
] | 80 | 2018-05-25T00:37:25.000Z | 2022-03-13T12:31:02.000Z | events/key_event.py | gbkim000/wxPython | b1604d71cf04801f9efa8b26b935561a88ef1daa | [
"BSD-2-Clause"
] | 1 | 2021-01-08T20:22:52.000Z | 2021-01-08T20:22:52.000Z | events/key_event.py | gbkim000/wxPython | b1604d71cf04801f9efa8b26b935561a88ef1daa | [
"BSD-2-Clause"
] | 32 | 2018-05-24T05:40:55.000Z | 2022-03-24T00:32:11.000Z | #!/usr/bin/python
"""
ZetCode wxPython tutorial
In this example we work with wx.KeyEvent.
author: Jan Bodnar
website: www.zetcode.com
last modified: April 2018
"""
if __name__ == '__main__':
main()
| 17.018182 | 69 | 0.564103 | #!/usr/bin/python
"""
ZetCode wxPython tutorial
In this example we work with wx.KeyEvent.
author: Jan Bodnar
website: www.zetcode.com
last modified: April 2018
"""
import wx
class Example(wx.Frame):
def __init__(self, *args, **kw):
super(Example, self).__init__(*args, **kw)
self.InitUI()
... | 0 | 0 | 0 | 605 | 0 | 66 | 0 | -12 | 69 |
be66dc89b4cae8f2ff5d0d04b1206d04caa26d25 | 635 | py | Python | Demo/tkinter/www/www7.py | 1byte2bytes/cpython | 7fbaeb819ca7b20dca048217ff585ec195e999ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | 1 | 2019-10-25T21:41:07.000Z | 2019-10-25T21:41:07.000Z | Demo/tkinter/www/www7.py | 1byte2bytes/cpython | 7fbaeb819ca7b20dca048217ff585ec195e999ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | Demo/tkinter/www/www7.py | 1byte2bytes/cpython | 7fbaeb819ca7b20dca048217ff585ec195e999ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | #! /usr/bin/env python
# www7.py -- display the contents of a URL in a Text widget
# - set window title
# - make window resizable
# - update display while reading
main()
| 18.676471 | 59 | 0.644094 | #! /usr/bin/env python
# www7.py -- display the contents of a URL in a Text widget
# - set window title
# - make window resizable
# - update display while reading
import sys
import urllib
from Tkinter import *
def main():
if len(sys.argv) != 2 or sys.argv[1][:1] == '-':
print "Usage:", sys.argv[0], "url"
sys.ex... | 0 | 0 | 0 | 0 | 0 | 392 | 0 | -19 | 90 |
21a3514af4c30e4ebd00509940462b21d40133f4 | 395 | py | Python | edaboweb/db_models.py | mineo/edaboweb | f5356f15d0b222d63d57c4fb200f9fe92e8d4a80 | [
"MIT"
] | null | null | null | edaboweb/db_models.py | mineo/edaboweb | f5356f15d0b222d63d57c4fb200f9fe92e8d4a80 | [
"MIT"
] | 1 | 2016-10-30T22:44:21.000Z | 2016-10-30T22:44:21.000Z | edaboweb/db_models.py | mineo/edaboweb | f5356f15d0b222d63d57c4fb200f9fe92e8d4a80 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# Copyright 2015 Wieland Hoffmann
# License: MIT, see LICENSE for details
from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy()
| 26.333333 | 54 | 0.739241 | #!/usr/bin/env python
# coding: utf-8
# Copyright © 2015 Wieland Hoffmann
# License: MIT, see LICENSE for details
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.dialects.postgresql import JSONB, UUID
db = SQLAlchemy()
class Playlist(db.Model):
id = db.Column(db.Integer, primary_key=True)
gid = d... | 2 | 0 | 0 | 139 | 0 | 0 | 0 | 33 | 45 |
adebb7df6affffc6b7b0abeb8b769ff7e9d188bc | 195 | py | Python | scratch.py | 51762344/YOLOX | cbd28064d452c300171da5231038afb098ed2675 | [
"Apache-2.0"
] | null | null | null | scratch.py | 51762344/YOLOX | cbd28064d452c300171da5231038afb098ed2675 | [
"Apache-2.0"
] | null | null | null | scratch.py | 51762344/YOLOX | cbd28064d452c300171da5231038afb098ed2675 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import cv2
import matplotlib.pyplot as plt
a=torch.randn(6,6,3)
a_s = a.numpy()
im=cv2.imread('./assets/dog.jpg')
plt.imshow(im)
plt.show() | 16.25 | 33 | 0.733333 | import torch
import torch.nn as nn
import numpy as np
import cv2
import matplotlib.pyplot as plt
a=torch.randn(6,6,3)
a_s = a.numpy()
im=cv2.imread('./assets/dog.jpg')
plt.imshow(im)
plt.show() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
9290363d8b39e47a0d8cc51bf955c504a279b43d | 601 | py | Python | jet_guestbook/schema.py | rbw/jet-guestbook | 34be64094cc4628c2d7ea68b747142332ca77176 | [
"MIT"
] | null | null | null | jet_guestbook/schema.py | rbw/jet-guestbook | 34be64094cc4628c2d7ea68b747142332ca77176 | [
"MIT"
] | 4 | 2020-03-24T16:53:56.000Z | 2021-06-01T23:27:09.000Z | jet_guestbook/schema.py | rbw/jet-guestbook | 34be64094cc4628c2d7ea68b747142332ca77176 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 22.259259 | 54 | 0.650582 | # -*- coding: utf-8 -*-
from jetfactory.schema import fields, Schema
class Visitor(Schema):
id = fields.Integer()
name = fields.String()
location = fields.String()
class Visit(Schema):
id = fields.Integer()
visitor = fields.Nested(Visitor)
visited_on = fields.String(attribute='created_on')
... | 0 | 0 | 0 | 459 | 0 | 0 | 0 | 23 | 92 |
24c073c8d7c0450b39459d4608731f34e4b16c58 | 792 | py | Python | application/migrations/0001_initial.py | logisticAKB/speech2face | 596404669d69615cfe12884d7a3a0b1a61d85455 | [
"MIT"
] | null | null | null | application/migrations/0001_initial.py | logisticAKB/speech2face | 596404669d69615cfe12884d7a3a0b1a61d85455 | [
"MIT"
] | null | null | null | application/migrations/0001_initial.py | logisticAKB/speech2face | 596404669d69615cfe12884d7a3a0b1a61d85455 | [
"MIT"
] | 1 | 2021-09-06T16:23:14.000Z | 2021-09-06T16:23:14.000Z | # Generated by Django 3.2.2 on 2021-05-15 19:29
| 30.461538 | 139 | 0.64899 | # Generated by Django 3.2.2 on 2021-05-15 19:29
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 0 | 0 | 0 | 612 | 0 | 0 | 0 | 41 | 90 |
a1fcb95965b611e2f57f9674fd40ec6c0ca538e6 | 4,115 | py | Python | ONNX2MPS.py | prisma-ai/Smelter | 60ccdda977ab6ae70e46d70f300598da3f796761 | [
"MIT"
] | 53 | 2019-05-11T14:06:30.000Z | 2022-03-25T23:19:53.000Z | ONNX2MPS.py | prisma-ai/Smelter | 60ccdda977ab6ae70e46d70f300598da3f796761 | [
"MIT"
] | 2 | 2020-04-15T17:16:43.000Z | 2021-03-02T10:01:32.000Z | ONNX2MPS.py | prisma-ai/Smelter | 60ccdda977ab6ae70e46d70f300598da3f796761 | [
"MIT"
] | 6 | 2019-05-13T02:26:49.000Z | 2022-01-18T10:15:47.000Z | import numpy as np
DATA_TYPES = {
np.float32: 1,
np.float16: 10
}
if __name__ == "__main__":
main()
| 29.818841 | 102 | 0.626002 | import onnx
from onnx import optimizer
from onnx import numpy_helper
import numpy as np
import argparse
DATA_TYPES = {
np.float32: 1,
np.float16: 10
}
def tensorInfosToType(tensor_infos, data_type):
return [
onnx.helper.make_tensor_value_info(
tensor_info.name,
DATA_TYPE... | 0 | 0 | 0 | 0 | 0 | 3,722 | 0 | -3 | 272 |
d785d8d7c87b599e9a494b12c4f7beef29c8fbdd | 1,913 | py | Python | questions/migrations/0001_initial.py | shuoO-24/QA-Community | f993fa811e6b266f0ae13612e6183542753a1fc2 | [
"MIT"
] | null | null | null | questions/migrations/0001_initial.py | shuoO-24/QA-Community | f993fa811e6b266f0ae13612e6183542753a1fc2 | [
"MIT"
] | null | null | null | questions/migrations/0001_initial.py | shuoO-24/QA-Community | f993fa811e6b266f0ae13612e6183542753a1fc2 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2022-03-06 18:34
| 39.040816 | 118 | 0.581809 | # Generated by Django 3.1.4 on 2022-03-06 18:34
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 0 | 0 | 0 | 1,733 | 0 | 0 | 0 | 41 | 90 |
9b4e9b4d0102f015a755cb3895d0c5209066a6ae | 379 | py | Python | olami/ServerProcess.py | Kamigami55/goddog | 5a3efc9c3bf861a89ca14eb15c452e98c2c7eb13 | [
"MIT"
] | 6 | 2017-07-22T07:12:44.000Z | 2020-12-11T09:22:27.000Z | olami/ServerProcess.py | Kamigami55/SigmaGo | 5a3efc9c3bf861a89ca14eb15c452e98c2c7eb13 | [
"MIT"
] | null | null | null | olami/ServerProcess.py | Kamigami55/SigmaGo | 5a3efc9c3bf861a89ca14eb15c452e98c2c7eb13 | [
"MIT"
] | null | null | null | '''
Created on Jun 28, 2017
@author: make ma
''' | 15.16 | 53 | 0.546174 | '''
Created on Jun 28, 2017
@author: make ma
'''
from threading import Thread
class ServerProcess(Thread):
'''
classdocs
'''
def __init__(self):
Thread.__init__(self, name = "ServerProcess")
def init(self, handler):
self.handler = handler
return True
... | 0 | 0 | 0 | 277 | 0 | 0 | 0 | 7 | 46 |
58aafc53d0304d58a50c206c27c0117462a581a1 | 1,375 | py | Python | auto_data_extraction.py | williamabreu/dtn-benckmark | eb76c902caebea741e86087d8e66d004787aea1b | [
"MIT"
] | null | null | null | auto_data_extraction.py | williamabreu/dtn-benckmark | eb76c902caebea741e86087d8e66d004787aea1b | [
"MIT"
] | null | null | null | auto_data_extraction.py | williamabreu/dtn-benckmark | eb76c902caebea741e86087d8e66d004787aea1b | [
"MIT"
] | null | null | null | import os, json
META = None
PATH = os.path.dirname(os.path.realpath(__file__))
with open(f'{PATH}/META.json') as fp:
META = json.load(fp)
OUTPUT = []
for index in META:
transmit_range = META[index]["transmit_range"]
amount_nodes = META[index]["amount_nodes"]
routing_protocol = META[index]["routing_p... | 32.738095 | 98 | 0.610182 | import os, json
META = None
PATH = os.path.dirname(os.path.realpath(__file__))
with open(f'{PATH}/META.json') as fp:
META = json.load(fp)
OUTPUT = []
for index in META:
transmit_range = META[index]["transmit_range"]
amount_nodes = META[index]["amount_nodes"]
routing_protocol = META[index]["routing_p... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a918390cf5df3bf0e6510bc3aa318cd89af5f39c | 3,680 | py | Python | Examples/pendulum_groundtruth.py | zehuilu/Learning-from-Sparse-Demonstrations | 4d652635c24f847fe51bc050773762b549ce41c0 | [
"MIT"
] | 8 | 2020-08-16T00:09:57.000Z | 2021-09-24T00:58:46.000Z | Examples/pendulum_groundtruth.py | zehuilu/Learning-from-Sparse-Demonstrations | 4d652635c24f847fe51bc050773762b549ce41c0 | [
"MIT"
] | null | null | null | Examples/pendulum_groundtruth.py | zehuilu/Learning-from-Sparse-Demonstrations | 4d652635c24f847fe51bc050773762b549ce41c0 | [
"MIT"
] | 2 | 2021-01-26T02:33:13.000Z | 2021-08-25T01:52:07.000Z | #!/usr/bin/env python3
import os
import sys
sys.path.append(os.getcwd()+'/CPDP')
sys.path.append(os.getcwd()+'/JinEnv')
sys.path.append(os.getcwd()+'/lib')
import CPDP
import JinEnv
# ---------------------------------------load environment---------------------------------------
env = JinEnv.SinglePendulum()
env.initD... | 37.55102 | 127 | 0.638043 | #!/usr/bin/env python3
import os
import sys
import time
sys.path.append(os.getcwd()+'/CPDP')
sys.path.append(os.getcwd()+'/JinEnv')
sys.path.append(os.getcwd()+'/lib')
import CPDP
import JinEnv
from casadi import *
from scipy.integrate import solve_ivp
import scipy.io as sio
# ---------------------------------------l... | 0 | 0 | 0 | 0 | 0 | 670 | 0 | 6 | 110 |
0003ef7cdcd517a222d67d15824b55d08f4c7264 | 238 | py | Python | python/ccc17j3.py | ThePeeps191/dmoj-solutions | 7137e945f3f595c481ad4d29e1dc3a77d8b26e55 | [
"MIT"
] | 1 | 2022-01-23T16:02:14.000Z | 2022-01-23T16:02:14.000Z | python/ccc17j3.py | ThePeeps191/dmoj-solutions | 7137e945f3f595c481ad4d29e1dc3a77d8b26e55 | [
"MIT"
] | 5 | 2022-01-23T00:16:49.000Z | 2022-01-30T04:37:45.000Z | python/ccc17j3.py | ThePeeps191/dmoj-solutions | 7137e945f3f595c481ad4d29e1dc3a77d8b26e55 | [
"MIT"
] | 1 | 2022-01-23T00:03:47.000Z | 2022-01-23T00:03:47.000Z | # simple math
ab = input().split()
cd = input().split()
t = int(input())
dist_x = abs(int(ab[0]) - int(cd[0]))
dist_y = abs(int(ab[1]) - int(cd[1]))
dist = dist_x + dist_y
if t >= dist and t % 2 == dist % 2:
print("Y")
else:
print("N") | 19.833333 | 37 | 0.563025 | # simple math
ab = input().split()
cd = input().split()
t = int(input())
dist_x = abs(int(ab[0]) - int(cd[0]))
dist_y = abs(int(ab[1]) - int(cd[1]))
dist = dist_x + dist_y
if t >= dist and t % 2 == dist % 2:
print("Y")
else:
print("N") | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3718ceab5f222f8bca69a426afe8d8811525e688 | 728 | py | Python | Practical/Easy/PDF Tagger/pdftag.py | saintwithataint/Pro-g-rammingChallenges4 | 3f720a375b89ee289237819c2dc89226634b7a5b | [
"Apache-2.0"
] | 1 | 2022-03-16T16:47:22.000Z | 2022-03-16T16:47:22.000Z | Practical/Easy/PDF Tagger/pdftag.py | saintwithataint/Pro-g-rammingChallenges4 | 3f720a375b89ee289237819c2dc89226634b7a5b | [
"Apache-2.0"
] | null | null | null | Practical/Easy/PDF Tagger/pdftag.py | saintwithataint/Pro-g-rammingChallenges4 | 3f720a375b89ee289237819c2dc89226634b7a5b | [
"Apache-2.0"
] | 2 | 2022-02-02T18:02:03.000Z | 2022-03-16T16:47:34.000Z | from PyPDF3 import PdfFileReader, PdfFileWriter
import tkinter as tk
from tkinter import filedialog
root = tk.Tk()
root.withdraw()
path = filedialog.askopenfilename()
file = open(path, "rb")
pdf = PdfFileReader(file)
writer = PdfFileWriter()
writer.appendPagesFromReader(pdf)
metadata = pdf.getDocumentInfo()
writer.a... | 24.266667 | 60 | 0.726648 | from PyPDF3 import PdfFileReader, PdfFileWriter
import tkinter as tk
from tkinter import filedialog
root = tk.Tk()
root.withdraw()
path = filedialog.askopenfilename()
file = open(path, "rb")
pdf = PdfFileReader(file)
writer = PdfFileWriter()
writer.appendPagesFromReader(pdf)
metadata = pdf.getDocumentInfo()
writer.a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
65d3463171f37dd00804e5c05b52f1171ac471b8 | 3,529 | py | Python | dvmvs/losses.py | hashi0203/deep-video-mvs | b3943a9249d522dca3e6cd603e427f611cc7bad5 | [
"MIT"
] | 1 | 2022-01-10T07:51:41.000Z | 2022-01-10T07:51:41.000Z | dvmvs/losses.py | MorchelPeng/deep-video-mvs | fa14288f149c5af7b2a49092f729f5c4f44517ba | [
"MIT"
] | null | null | null | dvmvs/losses.py | MorchelPeng/deep-video-mvs | fa14288f149c5af7b2a49092f729f5c4f44517ba | [
"MIT"
] | null | null | null | from __future__ import division
| 42.518072 | 146 | 0.676679 | from __future__ import division
import torch
from torch import nn
class LossMeter(object):
def __init__(self):
self.count = 0.0
self.sum = 0.0
self.avg = 0.0
self.item_average = 0.0
def update(self, loss, count):
self.sum += loss
self.count += count
s... | 0 | 0 | 0 | 397 | 0 | 2,993 | 0 | -10 | 114 |
019a6dca1b77aa78438a09bb38052b4373c21627 | 3,130 | py | Python | danceschool/prerequisites/migrations/0002_auto_20170717_1642.py | benjwrdill/django-danceschool | 9ecb2754502e62d0f49aa23d08ca6de6cae3c99a | [
"BSD-3-Clause"
] | 32 | 2017-09-12T04:25:25.000Z | 2022-03-21T10:48:07.000Z | danceschool/prerequisites/migrations/0002_auto_20170717_1642.py | benjwrdill/django-danceschool | 9ecb2754502e62d0f49aa23d08ca6de6cae3c99a | [
"BSD-3-Clause"
] | 97 | 2017-09-01T02:43:08.000Z | 2022-01-03T18:20:34.000Z | danceschool/prerequisites/migrations/0002_auto_20170717_1642.py | benjwrdill/django-danceschool | 9ecb2754502e62d0f49aa23d08ca6de6cae3c99a | [
"BSD-3-Clause"
] | 19 | 2017-09-26T13:34:46.000Z | 2022-03-21T10:48:10.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-07-17 16:42
from __future__ import unicode_literals
| 45.362319 | 240 | 0.652716 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-07-17 16:42
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('prerequisites', '0001_initial'),
]
operations = [
... | 0 | 0 | 0 | 2,918 | 0 | 0 | 0 | 30 | 68 |
982f5345005882e6c562f6fb5bcbc6a019db11fb | 25,941 | py | Python | api/views.py | 404-wave/404-project | 3ee2ca672e4a69f91c997a8988904481e26b3263 | [
"Apache-2.0"
] | 2 | 2019-03-15T17:34:03.000Z | 2019-03-24T21:39:45.000Z | api/views.py | 404-wave/404-project | 3ee2ca672e4a69f91c997a8988904481e26b3263 | [
"Apache-2.0"
] | 11 | 2019-02-14T03:14:49.000Z | 2022-01-13T01:03:59.000Z | api/views.py | 404-wave/404-project | 3ee2ca672e4a69f91c997a8988904481e26b3263 | [
"Apache-2.0"
] | 5 | 2019-01-26T01:52:10.000Z | 2019-05-01T23:12:27.000Z |
import socket
import requests
import uuid
# Checks if we have enabled sharing posts with other servers
# When you add a remote host as a user, you need to make sure to add the HOST
# field. That way we know what the hostname is of the remote host. We need this
# because some groups might not even send the remote ho... | 36.691655 | 156 | 0.600709 | from django.shortcuts import render, get_object_or_404
from django.db.models import Q
from django.utils import timezone
from rest_framework import pagination, generics, views, status, mixins
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.parsers import JSONPar... | 0 | 0 | 0 | 22,889 | 0 | 1,601 | 0 | 385 | 672 |
f464e613bec0e28c7e2ce25f551d6b2c531780d5 | 9,286 | py | Python | solvers/solver2.py | sberbank-ai/combined_solution_aij2019 | fb194595adddae2d96141c4c6d1bbb3f3e20994e | [
"MIT"
] | 15 | 2019-12-19T07:36:09.000Z | 2022-01-27T03:27:55.000Z | solvers/solver2.py | sberbank-ai/combined_solution_aij2019 | fb194595adddae2d96141c4c6d1bbb3f3e20994e | [
"MIT"
] | 1 | 2021-06-02T00:47:53.000Z | 2021-06-02T00:47:53.000Z | solvers/solver2.py | sberbank-ai/combined_solution_aij2019 | fb194595adddae2d96141c4c6d1bbb3f3e20994e | [
"MIT"
] | 5 | 2019-12-19T12:00:15.000Z | 2021-02-19T15:28:14.000Z | # niw
| 40.907489 | 88 | 0.507646 | # niw
import re
from nltk.tokenize import sent_tokenize
from string import punctuation
from solvers.solver_helpers import RubertForMasking, AbstractSolver
class Solver(AbstractSolver):
def __init__(self):
self.dictionary_words = {}
self.rubert = RubertForMasking()
@staticmethod
def get_... | 2,115 | 1,248 | 0 | 6,802 | 0 | 0 | 0 | 61 | 113 |
90b585c2bf8cc577c1f63e619b6ae4ba043de9c5 | 7,494 | py | Python | fintool/transac.py | soote1/fintool | 2cac345a5f10cc1aea3c748b8b68cf9667ae2536 | [
"MIT"
] | null | null | null | fintool/transac.py | soote1/fintool | 2cac345a5f10cc1aea3c748b8b68cf9667ae2536 | [
"MIT"
] | null | null | null | fintool/transac.py | soote1/fintool | 2cac345a5f10cc1aea3c748b8b68cf9667ae2536 | [
"MIT"
] | null | null | null | """
This module provides classes to create and manage transactions.
"""
| 29.388235 | 81 | 0.571257 | """
This module provides classes to create and manage transactions.
"""
import uuid
import datetime
from fintool.db import DbFactory
from fintool.logging import LoggingHelper
class Error(Exception):
"""Base class for all errors in this module.
"""
class MissingFieldError(Error):
"""
Raised when t... | 0 | 609 | 0 | 6,539 | 0 | 0 | 0 | 15 | 251 |
817239480246feaf671da5f4c699b449a69da468 | 509 | py | Python | Scope.py | Nikuchan/FILES-AND-OOP | 2ef1f370c08ec47054f1c7efd374281d628e70a4 | [
"MIT"
] | null | null | null | Scope.py | Nikuchan/FILES-AND-OOP | 2ef1f370c08ec47054f1c7efd374281d628e70a4 | [
"MIT"
] | null | null | null | Scope.py | Nikuchan/FILES-AND-OOP | 2ef1f370c08ec47054f1c7efd374281d628e70a4 | [
"MIT"
] | null | null | null | #x= 'Global x'
print("\nTesting Global and Local Scope")
test()
print(x)
m=min([3,4,5,6])
print(m)
print("\nTesting Enclosing Scope")
outer() | 18.851852 | 99 | 0.616896 | #x= 'Global x'
print("\nTesting Global and Local Scope")
def test():
global x #Explicitly telling python that we want to work on Global x Variable
#y='Local y'
x='Local x'
#print(y)
print(x)
test()
print(x)
m=min([3,4,5,6])
print(m)
print("\nTesting Enclosing Scope")
def outer():
x='outer x'
... | 0 | 0 | 0 | 0 | 0 | 321 | 0 | 0 | 44 |
86bf2fd58db454b1efa2802cd8ef742a11b11145 | 1,997 | py | Python | tests/integration/lib/api_session.py | afharo/elastic-stack-testing | 3aea11ea4627dc20a0578408191961ff11b5aa0b | [
"Apache-2.0"
] | 44 | 2018-03-10T19:43:47.000Z | 2022-03-13T09:41:56.000Z | tests/integration/lib/api_session.py | afharo/elastic-stack-testing | 3aea11ea4627dc20a0578408191961ff11b5aa0b | [
"Apache-2.0"
] | 144 | 2018-03-09T21:44:03.000Z | 2022-03-31T23:21:12.000Z | tests/integration/lib/api_session.py | afharo/elastic-stack-testing | 3aea11ea4627dc20a0578408191961ff11b5aa0b | [
"Apache-2.0"
] | 32 | 2018-03-06T19:56:47.000Z | 2021-11-03T11:27:27.000Z | '''
Created on Sep 29, 2017
@author: Liza Dayoub
'''
| 28.942029 | 71 | 0.604907 | '''
Created on Sep 29, 2017
@author: Liza Dayoub
'''
import requests
from requests.packages.urllib3 import disable_warnings
from requests.packages.urllib3.exceptions import InsecureRequestWarning
class ApiSession(object):
'''
classdocs
'''
def __init__(self, **kwargs):
'''
Construct... | 0 | 0 | 0 | 1,775 | 0 | 0 | 0 | 77 | 90 |
a41986a3ad2c39eeecf7f10cff6c74cfbd02ef8f | 809 | py | Python | day10/day10_a.py | AdamKinnell/AdventOfCode2017 | 28f506a39245198489d3da9535b190e6f98e92d1 | [
"MIT"
] | null | null | null | day10/day10_a.py | AdamKinnell/AdventOfCode2017 | 28f506a39245198489d3da9535b190e6f98e92d1 | [
"MIT"
] | null | null | null | day10/day10_a.py | AdamKinnell/AdventOfCode2017 | 28f506a39245198489d3da9535b190e6f98e92d1 | [
"MIT"
] | null | null | null |
# Entry Point #######################################################
lengths = list(map(int, open('day10.txt').read().split(',')))
string = hash(256, lengths)
print(string[0] * string[1]) # = 46600
| 25.28125 | 69 | 0.584672 |
def reverse_elements(lst, start_i, count):
to_end = min(len(lst) - start_i, count)
from_start = count - to_end
elements = lst[start_i:start_i+to_end]
elements += lst[0:from_start]
elements = list(reversed(elements))
lst[start_i:start_i+to_end] = elements[:to_end]
lst[0:from_start] = elemen... | 0 | 0 | 0 | 0 | 0 | 561 | 0 | 0 | 46 |