hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1f5c00c451eb634e1ec25e5569a671164a9709 | 8,667 | py | Python | ns-3-dev/src/netanim/bindings/callbacks_list.py | Marquez607/Wireless-Perf-Sim | 1086759b6dbe7da192225780d5fe6a3da0c5eb07 | [
"MIT"
] | 1 | 2022-03-22T08:08:35.000Z | 2022-03-22T08:08:35.000Z | ns-3-dev/src/netanim/bindings/callbacks_list.py | Marquez607/Wireless-Perf-Sim | 1086759b6dbe7da192225780d5fe6a3da0c5eb07 | [
"MIT"
] | null | null | null | ns-3-dev/src/netanim/bindings/callbacks_list.py | Marquez607/Wireless-Perf-Sim | 1086759b6dbe7da192225780d5fe6a3da0c5eb07 | [
"MIT"
] | null | null | null | callback_classes = [
['ns3::ObjectBase *', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['... | 160.5 | 338 | 0.590054 | callback_classes = [
['ns3::ObjectBase *', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['... | true | true |
1c1f5c6418f896590f7544269d251a6f2d91dd60 | 4,044 | py | Python | pennylane/optimize/adam.py | antalszava/pennylane | 924ff06170229d62800699387ebf91cef94193e8 | [
"Apache-2.0"
] | 1 | 2019-05-12T22:43:42.000Z | 2019-05-12T22:43:42.000Z | pennylane/optimize/adam.py | shashanka300/pennylane | 194ccd00a9a7f7075c37680c970e56bab4808e60 | [
"Apache-2.0"
] | null | null | null | pennylane/optimize/adam.py | shashanka300/pennylane | 194ccd00a9a7f7075c37680c970e56bab4808e60 | [
"Apache-2.0"
] | 1 | 2022-03-04T02:17:11.000Z | 2022-03-04T02:17:11.000Z | # Copyright 2018 Xanadu Quantum Technologies Inc.
# 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 agre... | 38.514286 | 112 | 0.623887 |
import autograd.numpy as np
from pennylane.utils import _flatten, unflatten
from .gradient_descent import GradientDescentOptimizer
class AdamOptimizer(GradientDescentOptimizer):
def __init__(self, stepsize=0.01, beta1=0.9, beta2=0.99, eps=1e-8):
super().__init__(stepsize)
self.beta1 ... | true | true |
1c1f5d55e8503c2786c11eb30377181f62900207 | 1,904 | py | Python | IntroToSQL/exam4.py | MuhammetALAPAN/Kaggle.com-Sql-BigQuery-Studies | b17568dd9cd074629a8789ca3c2fc351030f76a7 | [
"MIT"
] | null | null | null | IntroToSQL/exam4.py | MuhammetALAPAN/Kaggle.com-Sql-BigQuery-Studies | b17568dd9cd074629a8789ca3c2fc351030f76a7 | [
"MIT"
] | null | null | null | IntroToSQL/exam4.py | MuhammetALAPAN/Kaggle.com-Sql-BigQuery-Studies | b17568dd9cd074629a8789ca3c2fc351030f76a7 | [
"MIT"
] | null | null | null | from google.cloud import bigquery
from google.oauth2 import service_account
credentials = service_account.Credentials.from_service_account_file("C:/Users/muhem/Desktop/"
"sqlbigquerytraining-836d50cb80ec.json")
client = bigquery.Client(credentials=cre... | 39.666667 | 108 | 0.728992 | from google.cloud import bigquery
from google.oauth2 import service_account
credentials = service_account.Credentials.from_service_account_file("C:/Users/muhem/Desktop/"
"sqlbigquerytraining-836d50cb80ec.json")
client = bigquery.Client(credentials=cre... | true | true |
1c1f5e3250fcb52328e14a6bd991412afb5785aa | 1,471 | py | Python | bireme/attachments/migrations/0001_initial.py | rfdeoliveira/fi-admin | c2df084c7e79d587e2273dc222f106fa243b7f6e | [
"MIT",
"Python-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | bireme/attachments/migrations/0001_initial.py | rfdeoliveira/fi-admin | c2df084c7e79d587e2273dc222f106fa243b7f6e | [
"MIT",
"Python-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | bireme/attachments/migrations/0001_initial.py | rfdeoliveira/fi-admin | c2df084c7e79d587e2273dc222f106fa243b7f6e | [
"MIT",
"Python-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import attachments.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', ... | 42.028571 | 136 | 0.632223 |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import attachments.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', '0001_initial'),
]
... | true | true |
1c1f5e3c42dfab1e34d5f061d0c8606ecf94ed5c | 39,685 | py | Python | Bike_Share_Analysis.py | Hiteshsaai/BikeShare_DataAnalysis | 544f5176835882138ca8ae7ec460a9d405d2e30f | [
"MIT"
] | null | null | null | Bike_Share_Analysis.py | Hiteshsaai/BikeShare_DataAnalysis | 544f5176835882138ca8ae7ec460a9d405d2e30f | [
"MIT"
] | null | null | null | Bike_Share_Analysis.py | Hiteshsaai/BikeShare_DataAnalysis | 544f5176835882138ca8ae7ec460a9d405d2e30f | [
"MIT"
] | null | null | null |
# coding: utf-8
# # 2016 US Bike Share Activity Snapshot
#
# ## Table of Contents
# - [Introduction](#intro)
# - [Posing Questions](#pose_questions)
# - [Data Collection and Wrangling](#wrangling)
# - [Condensing the Trip Data](#condensing)
# - [Exploratory Data Analysis](#eda)
# - [Statistics](#statistics)
# ... | 52.842876 | 841 | 0.689354 |
visit these pages, you will notice that each city has a different way of delivering its data. Chicago updates with new data twice a year, Washington DC is quarterly, and New York City is monthly. **However, you do not need to download the data yourself.** The data has already been collected for you in the `/data/` ... | true | true |
1c1f5e4a3be31bd1899cac98326ce32dd949b705 | 1,037 | py | Python | train.py | ChengIC/text_classifier | e7265deebb30a3bab1c3e8a4a0a829f659b32e1c | [
"MIT"
] | null | null | null | train.py | ChengIC/text_classifier | e7265deebb30a3bab1c3e8a4a0a829f659b32e1c | [
"MIT"
] | null | null | null | train.py | ChengIC/text_classifier | e7265deebb30a3bab1c3e8a4a0a829f659b32e1c | [
"MIT"
] | null | null | null |
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
import pickle
df= pd.read_csv("spam.csv", encoding="latin-1")
# print (df.head())
df.drop(['Unnamed: 2', 'Unnamed: 3', 'Unnamed: 4'], axis=1, inplace=True)
# Features and Labels
df['label'] = df['v1'].map({'ham': 0, 'spam': 1})
X = df['v... | 27.289474 | 90 | 0.728062 |
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
import pickle
df= pd.read_csv("spam.csv", encoding="latin-1")
df.drop(['Unnamed: 2', 'Unnamed: 3', 'Unnamed: 4'], axis=1, inplace=True)
df['label'] = df['v1'].map({'ham': 0, 'spam': 1})
X = df['v2']
print (X)
y = df['label']
cv = Coun... | true | true |
1c1f603fbee2af83a396d863ed563894dab299e0 | 701 | py | Python | maquinaria/alquileres/models/alquileres.py | CFredy9/Maquinaria | 7b55d2e882702b62cdbb11f9684ab54d9b485199 | [
"MIT"
] | null | null | null | maquinaria/alquileres/models/alquileres.py | CFredy9/Maquinaria | 7b55d2e882702b62cdbb11f9684ab54d9b485199 | [
"MIT"
] | null | null | null | maquinaria/alquileres/models/alquileres.py | CFredy9/Maquinaria | 7b55d2e882702b62cdbb11f9684ab54d9b485199 | [
"MIT"
] | null | null | null | """Modelo de Alquileres"""
#Django
from django.db import models
from django.utils import timezone
#Utilities
from maquinaria.utils.models import CRideModel
from maquinaria.maquinas.models import Maquina
from datetime import datetime
from datetime import timedelta
class Alquiler(CRideModel):
cliente = models.F... | 22.612903 | 74 | 0.796006 |
from django.db import models
from django.utils import timezone
from maquinaria.utils.models import CRideModel
from maquinaria.maquinas.models import Maquina
from datetime import datetime
from datetime import timedelta
class Alquiler(CRideModel):
cliente = models.ForeignKey('clientes.Cliente', on_delete=mode... | true | true |
1c1f60c1cca5481e4686cae7cb31f6bfe6c39f41 | 7,788 | py | Python | posthog/urls.py | Jujhar/posthog | d4df76250632f84b830b76b0ec48caaafbed568f | [
"MIT"
] | null | null | null | posthog/urls.py | Jujhar/posthog | d4df76250632f84b830b76b0ec48caaafbed568f | [
"MIT"
] | 1 | 2020-04-25T13:19:59.000Z | 2020-04-25T13:20:17.000Z | posthog/urls.py | Jujhar/posthog | d4df76250632f84b830b76b0ec48caaafbed568f | [
"MIT"
] | null | null | null | from typing import cast, Optional
from django.contrib import admin
from django.urls import path, include, re_path
from django.views.generic.base import TemplateView
from django.http import HttpResponse, JsonResponse
from django.shortcuts import redirect
from django.contrib.auth import authenticate, login, views as auth... | 40.352332 | 194 | 0.682845 | from typing import cast, Optional
from django.contrib import admin
from django.urls import path, include, re_path
from django.views.generic.base import TemplateView
from django.http import HttpResponse, JsonResponse
from django.shortcuts import redirect
from django.contrib.auth import authenticate, login, views as auth... | true | true |
1c1f6203d93ed4ea8196505b5e25d4d2ff3fb90e | 116 | py | Python | app/views.py | samg11/socialize | f21dab705165f212eab0ed2ca3edb3890aef56ee | [
"MIT"
] | null | null | null | app/views.py | samg11/socialize | f21dab705165f212eab0ed2ca3edb3890aef56ee | [
"MIT"
] | null | null | null | app/views.py | samg11/socialize | f21dab705165f212eab0ed2ca3edb3890aef56ee | [
"MIT"
] | null | null | null | from flask import Blueprint
views = Blueprint('views', __name__)
@views.route('/')
def index():
return 'hello' | 16.571429 | 36 | 0.689655 | from flask import Blueprint
views = Blueprint('views', __name__)
@views.route('/')
def index():
return 'hello' | true | true |
1c1f62b5757a6c3e39e7a1f6c11ccdc3e95f2833 | 6,174 | py | Python | pybind/slxos/v17r_1_01a/routing_system/router/isis/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17r_1_01a/routing_system/router/isis/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17r_1_01a/routing_system/router/isis/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 49.790323 | 494 | 0.729997 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
1c1f62fdb73c99a5423f88341ac3d13a3e0b7917 | 3,029 | py | Python | venv/lib/python3.9/site-packages/_pytest/threadexception.py | almmello/frozen | c9928491f694b56a0023926bc763c703ba1fd75a | [
"BSD-2-Clause"
] | 9 | 2019-05-29T23:50:28.000Z | 2021-01-29T20:51:05.000Z | venv/lib/python3.9/site-packages/_pytest/threadexception.py | almmello/frozen | c9928491f694b56a0023926bc763c703ba1fd75a | [
"BSD-2-Clause"
] | 61 | 2020-10-12T13:34:56.000Z | 2022-03-28T03:02:21.000Z | venv/lib/python3.9/site-packages/_pytest/threadexception.py | almmello/frozen | c9928491f694b56a0023926bc763c703ba1fd75a | [
"BSD-2-Clause"
] | 3 | 2020-05-25T02:38:08.000Z | 2021-01-20T06:23:06.000Z | import threading
import traceback
import warnings
from types import TracebackType
from typing import Any
from typing import Callable
from typing import Generator
from typing import Optional
from typing import Type
import pytest
# Copied from cpython/Lib/test/support/threading_helper.py, with modifications.
class cat... | 33.285714 | 86 | 0.679102 | import threading
import traceback
import warnings
from types import TracebackType
from typing import Any
from typing import Callable
from typing import Generator
from typing import Optional
from typing import Type
import pytest
class catch_threading_exception:
def __init__(self) -> None:
self.... | true | true |
1c1f63c6208c616cf6bf344b54ae8b9f419147f3 | 1,609 | py | Python | setup.py | danieleteti/simplemonitor | e2cb5c22dd72145035f2e68cd9ce90e77fd147c3 | [
"BSD-3-Clause"
] | null | null | null | setup.py | danieleteti/simplemonitor | e2cb5c22dd72145035f2e68cd9ce90e77fd147c3 | [
"BSD-3-Clause"
] | null | null | null | setup.py | danieleteti/simplemonitor | e2cb5c22dd72145035f2e68cd9ce90e77fd147c3 | [
"BSD-3-Clause"
] | null | null | null | import setuptools
from simplemonitor.version import VERSION
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="simplemonitor",
version=VERSION,
author="James Seward",
author_email="james@jamesoff.net",
description="A simple network and host monitor",
l... | 30.942308 | 83 | 0.610938 | import setuptools
from simplemonitor.version import VERSION
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="simplemonitor",
version=VERSION,
author="James Seward",
author_email="james@jamesoff.net",
description="A simple network and host monitor",
l... | true | true |
1c1f642a5de5a33092bad3090d949f719fe6c2d9 | 1,166 | py | Python | pybuild/pgp_keys.py | 892768447/python3-android | 1933b4c9f5a7a51f737d7c70614339ca24631e99 | [
"WTFPL"
] | 1 | 2020-06-15T13:34:46.000Z | 2020-06-15T13:34:46.000Z | pybuild/pgp_keys.py | 892768447/python3-android | 1933b4c9f5a7a51f737d7c70614339ca24631e99 | [
"WTFPL"
] | null | null | null | pybuild/pgp_keys.py | 892768447/python3-android | 1933b4c9f5a7a51f737d7c70614339ca24631e99 | [
"WTFPL"
] | null | null | null | import itertools
import logging
import tempfile
import gnupg
from .package import enumerate_packages, import_package
from .util import BASE
GPG_SERVER = 'pool.sks-keyservers.net'
def main():
logging.basicConfig(level=logging.DEBUG)
with tempfile.TemporaryDirectory() as tmpdir:
gpg = gnupg.GPG(gnup... | 26.5 | 99 | 0.620069 | import itertools
import logging
import tempfile
import gnupg
from .package import enumerate_packages, import_package
from .util import BASE
GPG_SERVER = 'pool.sks-keyservers.net'
def main():
logging.basicConfig(level=logging.DEBUG)
with tempfile.TemporaryDirectory() as tmpdir:
gpg = gnupg.GPG(gnup... | true | true |
1c1f673a333e107032b02b5a1997b1f3e290932c | 5,645 | py | Python | tests/test_gocamgen.py | falquaddoomi/ontobio | 92231d447ab2fc8bfebcebac78b41e32af984379 | [
"BSD-3-Clause"
] | 101 | 2017-04-19T20:54:49.000Z | 2022-03-14T02:32:11.000Z | tests/test_gocamgen.py | falquaddoomi/ontobio | 92231d447ab2fc8bfebcebac78b41e32af984379 | [
"BSD-3-Clause"
] | 402 | 2017-04-24T19:53:12.000Z | 2022-03-31T20:27:59.000Z | tests/test_gocamgen.py | falquaddoomi/ontobio | 92231d447ab2fc8bfebcebac78b41e32af984379 | [
"BSD-3-Clause"
] | 30 | 2017-04-20T17:59:12.000Z | 2022-02-25T22:26:08.000Z | import pytest
import datetime
from ontobio.io import assocparser
from ontobio.io.gpadparser import to_association
from ontobio.ontol_factory import OntologyFactory
from ontobio.rdfgen.gocamgen import collapsed_assoc, gocam_builder, gocamgen
GO_ONTO = OntologyFactory().create("tests/resources/go-binding.json") # Place... | 41.814815 | 135 | 0.683437 | import pytest
import datetime
from ontobio.io import assocparser
from ontobio.io.gpadparser import to_association
from ontobio.ontol_factory import OntologyFactory
from ontobio.rdfgen.gocamgen import collapsed_assoc, gocam_builder, gocamgen
GO_ONTO = OntologyFactory().create("tests/resources/go-binding.json")
GO_ONT... | true | true |
1c1f676a3388bf7db3e947dc3c85949ac2486f08 | 10,682 | py | Python | processors/engine_comments_contract_processor.py | hive-engine/distribution-engine-smt | 9ed4fddbae17342700a4ba0f24c667c8b853c793 | [
"MIT"
] | null | null | null | processors/engine_comments_contract_processor.py | hive-engine/distribution-engine-smt | 9ed4fddbae17342700a4ba0f24c667c8b853c793 | [
"MIT"
] | null | null | null | processors/engine_comments_contract_processor.py | hive-engine/distribution-engine-smt | 9ed4fddbae17342700a4ba0f24c667c8b853c793 | [
"MIT"
] | null | null | null | # This Python file uses the following encoding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from beem.constants import STEEM_100_PERCENT
from beem.utils import resolve_authorperm, construct_authorperm
from dat... | 71.691275 | 1,310 | 0.611122 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from beem.constants import STEEM_100_PERCENT
from beem.utils import resolve_authorperm, construct_authorperm
from datetime import datetime, timedelta
from decimal import ... | true | true |
1c1f67f527a813471c6ff84e39cb0b151d279650 | 1,118 | py | Python | Python/PandocConvert/PandocConvert.py | tduoth/JsObjects | eb3e2a8b1f47d0da53c8b1a85a7949269711932f | [
"MIT"
] | 22 | 2015-02-26T09:07:18.000Z | 2020-05-10T16:22:05.000Z | Python/PandocConvert/PandocConvert.py | tduoth/JsObjects | eb3e2a8b1f47d0da53c8b1a85a7949269711932f | [
"MIT"
] | 123 | 2016-04-05T18:32:41.000Z | 2022-03-13T21:09:21.000Z | Python/PandocConvert/PandocConvert.py | tduoth/JsObjects | eb3e2a8b1f47d0da53c8b1a85a7949269711932f | [
"MIT"
] | 56 | 2015-03-19T22:26:37.000Z | 2021-12-06T02:52:02.000Z | #!/bin/python
import os, fnmatch
from subprocess import call
class RunPandoc():
def runPandoc(self, fileName):
pandoc="C:\\Program Files (x86)\\Pandoc\\bin\\pandoc.exe"
paramData={"fileName": fileName, "ext1":"md", "ext2":"html"}
markdownName="%(fileName)s.%(ext1)s" % paramData
htmlName="%(fileName)s.%(ext2... | 33.878788 | 78 | 0.692308 |
import os, fnmatch
from subprocess import call
class RunPandoc():
def runPandoc(self, fileName):
pandoc="C:\\Program Files (x86)\\Pandoc\\bin\\pandoc.exe"
paramData={"fileName": fileName, "ext1":"md", "ext2":"html"}
markdownName="%(fileName)s.%(ext1)s" % paramData
htmlName="%(fileName)s.%(ext2)s" % paramDa... | true | true |
1c1f686351b74293a7084d8a66804701f423ae72 | 1,757 | py | Python | Dictionary.py | sunny5156/xiaohei-contrib | 3e1103a41ca547d58a4ae28f893a74fc93706bca | [
"MIT"
] | null | null | null | Dictionary.py | sunny5156/xiaohei-contrib | 3e1103a41ca547d58a4ae28f893a74fc93706bca | [
"MIT"
] | null | null | null | Dictionary.py | sunny5156/xiaohei-contrib | 3e1103a41ca547d58a4ae28f893a74fc93706bca | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import urllib
import re
from urllib import urlencode
import sys
reload(sys)
sys.setdefaultencoding('utf8')
SLUG = "dictionary"
WORDS = ["CHENGYU"]
def getHtml(words):
url = 'http://dict.baidu.com/s'
values = {'wd' : words}
data = urlencode(values)
html = ""
... | 24.068493 | 69 | 0.519636 |
import urllib
import re
from urllib import urlencode
import sys
reload(sys)
sys.setdefaultencoding('utf8')
SLUG = "dictionary"
WORDS = ["CHENGYU"]
def getHtml(words):
url = 'http://dict.baidu.com/s'
values = {'wd' : words}
data = urlencode(values)
html = ""
try:
respon... | true | true |
1c1f686ddb20c304a59b560921765d9602020f8b | 29,825 | py | Python | python/ccxt/async/kucoin.py | stabilo/ccxt | c924456c5c9ea21cad33cb9b6bf5a8b8a23c5d42 | [
"MIT"
] | null | null | null | python/ccxt/async/kucoin.py | stabilo/ccxt | c924456c5c9ea21cad33cb9b6bf5a8b8a23c5d42 | [
"MIT"
] | null | null | null | python/ccxt/async/kucoin.py | stabilo/ccxt | c924456c5c9ea21cad33cb9b6bf5a8b8a23c5d42 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async.base.exchange import Exchange
import base64
import hashlib
import math
import json
from ccxt.base.errors import ExchangeErr... | 38.784135 | 126 | 0.481475 |
exchange import Exchange
import base64
import hashlib
import math
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.base.errors import OrderNotFound
from ccxt.base.... | false | true |
1c1f689c50210103fc8fd21882fa5b68dd8f610d | 36 | py | Python | model/rbm/realpos/__init__.py | remmyzen/nqs-tensorflow2 | 2af5d5ebb108eac4d2daa5082bdef11c8107bd1b | [
"MIT"
] | 4 | 2021-07-29T17:52:54.000Z | 2022-02-15T06:32:15.000Z | model/rbm/realpos/__init__.py | remmyzen/nqs-tensorflow2 | 2af5d5ebb108eac4d2daa5082bdef11c8107bd1b | [
"MIT"
] | null | null | null | model/rbm/realpos/__init__.py | remmyzen/nqs-tensorflow2 | 2af5d5ebb108eac4d2daa5082bdef11c8107bd1b | [
"MIT"
] | null | null | null | from .rbm_realpos import RBMRealPos
| 18 | 35 | 0.861111 | from .rbm_realpos import RBMRealPos
| true | true |
1c1f6982c72e5c2a71c05746a5e72374d8827ab3 | 579 | py | Python | Algorithms/Sort Algorithms/Insertion Sort.py | keivanipchihagh/Game-Theory-and-Intelligent-Thinking | 5eeb3d762336cd6f5f3e258130451b35eb956803 | [
"MIT"
] | 1 | 2021-04-06T08:40:29.000Z | 2021-04-06T08:40:29.000Z | Algorithms/Sort Algorithms/Insertion Sort.py | keivanipchihagh/Game-Theory-and-Intelligent-Thinking | 5eeb3d762336cd6f5f3e258130451b35eb956803 | [
"MIT"
] | null | null | null | Algorithms/Sort Algorithms/Insertion Sort.py | keivanipchihagh/Game-Theory-and-Intelligent-Thinking | 5eeb3d762336cd6f5f3e258130451b35eb956803 | [
"MIT"
] | null | null | null | # Import libraries
import random
# Simulation settings
debug = False
length = 10
# Make a list 0 - 10
arr = [i for i in range(length)]
# Shuffle the list
random.shuffle(arr)
# Insertion algorithm
for i in range(len(arr)):
j = i
# If the selected node is smaller than the previous one, shift left
while j... | 18.09375 | 71 | 0.606218 |
import random
debug = False
length = 10
arr = [i for i in range(length)]
random.shuffle(arr)
for i in range(len(arr)):
j = i
while j > 0 and arr[j - 1] > arr[j]:
arr[j - 1], arr[j] = arr[j], arr[j - 1]
j -= 1
if debug:
print(arr)
print(arr)
print('sorted:... | true | true |
1c1f69dd2e7f879431d289f42c07758bcdea32c5 | 262 | py | Python | demo/hello_login/run.py | dumpmemory/gradio | 748b1a4761c7f32e231c831a651595f5a33db039 | [
"Apache-2.0"
] | 1 | 2021-12-15T09:21:44.000Z | 2021-12-15T09:21:44.000Z | demo/hello_login/run.py | AK391/gradio | f3fa61cce8b0eab4f76c564216cda3108824020a | [
"Apache-2.0"
] | null | null | null | demo/hello_login/run.py | AK391/gradio | f3fa61cce8b0eab4f76c564216cda3108824020a | [
"Apache-2.0"
] | null | null | null | import gradio as gr
user_db = {"admin": "admin", "foo": "bar"}
def greet(name):
return "Hello " + name + "!!"
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
if __name__ == "__main__":
demo.launch(auth=lambda u, p: user_db.get(u) == p)
| 20.153846 | 60 | 0.614504 | import gradio as gr
user_db = {"admin": "admin", "foo": "bar"}
def greet(name):
return "Hello " + name + "!!"
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
if __name__ == "__main__":
demo.launch(auth=lambda u, p: user_db.get(u) == p)
| true | true |
1c1f69eb0d5cfe4bbd577e7c137feb2371188c74 | 1,428 | py | Python | conf_site/proposals/tests/__init__.py | jasongrout/conf_site | 6b3beb21de8d847cba65dcb6da84464b40739d48 | [
"MIT"
] | 13 | 2015-05-22T17:10:22.000Z | 2021-07-15T16:45:19.000Z | conf_site/proposals/tests/__init__.py | jasongrout/conf_site | 6b3beb21de8d847cba65dcb6da84464b40739d48 | [
"MIT"
] | 758 | 2015-03-18T13:39:25.000Z | 2022-03-31T13:14:09.000Z | conf_site/proposals/tests/__init__.py | jasongrout/conf_site | 6b3beb21de8d847cba65dcb6da84464b40739d48 | [
"MIT"
] | 16 | 2015-03-24T18:53:17.000Z | 2020-10-22T21:30:02.000Z | from django.contrib.auth import get_user_model
from django.test import TestCase
from faker import Faker
from conf_site.proposals.tests.factories import ProposalFactory
from symposion.schedule.tests.factories import (
ConferenceFactory,
SectionFactory,
)
from symposion.speakers.models import Speaker
class Pr... | 29.142857 | 74 | 0.673669 | from django.contrib.auth import get_user_model
from django.test import TestCase
from faker import Faker
from conf_site.proposals.tests.factories import ProposalFactory
from symposion.schedule.tests.factories import (
ConferenceFactory,
SectionFactory,
)
from symposion.speakers.models import Speaker
class Pr... | true | true |
1c1f6b12ea6a594244ec1c51163cf5ef9f61bbcd | 491 | py | Python | setup.py | chewvader/django-geonames | 8add62d34b4541479e3bd05f18a7eaae016d83b6 | [
"BSD-3-Clause"
] | 1 | 2016-02-26T09:10:44.000Z | 2016-02-26T09:10:44.000Z | setup.py | chewvader/django-geonames | 8add62d34b4541479e3bd05f18a7eaae016d83b6 | [
"BSD-3-Clause"
] | null | null | null | setup.py | chewvader/django-geonames | 8add62d34b4541479e3bd05f18a7eaae016d83b6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='django-geonames',
version=__import__('geonames').__version__,
description='Fork of official GeoDjango geonames application refactored and adopted for Django 1.2.1',
author='Justin Bronn',
author_email='jbronn@geodjan... | 30.6875 | 108 | 0.670061 |
from setuptools import setup, find_packages
setup(name='django-geonames',
version=__import__('geonames').__version__,
description='Fork of official GeoDjango geonames application refactored and adopted for Django 1.2.1',
author='Justin Bronn',
author_email='jbronn@geodjango.org',
url='h... | true | true |
1c1f6c8e1896242635abb4a3aac8412aeccb2d35 | 2,509 | py | Python | ucsmsdk/mometa/lstorage/LstorageLocalDiskRef.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/lstorage/LstorageLocalDiskRef.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/lstorage/LstorageLocalDiskRef.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for LstorageLocalDiskRef ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class LstorageLocalDiskRefConsts:
pass
class LstorageLocalDiskRef(ManagedObject):
"""This is Lst... | 51.204082 | 248 | 0.660821 |
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class LstorageLocalDiskRefConsts:
pass
class LstorageLocalDiskRef(ManagedObject):
consts = LstorageLocalDiskRefConsts()
naming_props = set([u'enclosureId', u'slotId'])
mo_meta =... | true | true |
1c1f6ee7ae88f753c10d3b26b2bbc070bd246d70 | 7,877 | py | Python | test/functional/rpc_users.py | ddanese/zdatacoin | cc08bf3eb4b2106a8ed0a67c01e949f5992757ac | [
"MIT"
] | null | null | null | test/functional/rpc_users.py | ddanese/zdatacoin | cc08bf3eb4b2106a8ed0a67c01e949f5992757ac | [
"MIT"
] | null | null | null | test/functional/rpc_users.py | ddanese/zdatacoin | cc08bf3eb4b2106a8ed0a67c01e949f5992757ac | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiple RPC users."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... | 38.05314 | 129 | 0.614701 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
get_datadir_path,
str_to_b64str,
)
import os
import http.client
import urllib.parse
import subprocess
from random import SystemRandom
import string
import configparser
import sys
class HTTP... | true | true |
1c1f6f5ca5539ed9fc0c1822aae60f664e2a148d | 107 | py | Python | src/visions/utils/monkeypatches/__init__.py | sweersr/visions | 1af04235cb77bec52e4923627dfbf968ed1a584d | [
"BSD-4-Clause"
] | null | null | null | src/visions/utils/monkeypatches/__init__.py | sweersr/visions | 1af04235cb77bec52e4923627dfbf968ed1a584d | [
"BSD-4-Clause"
] | null | null | null | src/visions/utils/monkeypatches/__init__.py | sweersr/visions | 1af04235cb77bec52e4923627dfbf968ed1a584d | [
"BSD-4-Clause"
] | null | null | null | from visions.utils.monkeypatches import imghdr_patch
from visions.utils.monkeypatches import pathlib_patch
| 35.666667 | 53 | 0.88785 | from visions.utils.monkeypatches import imghdr_patch
from visions.utils.monkeypatches import pathlib_patch
| true | true |
1c1f6f75bb7ae14ee8c36766b7ff1eff34319971 | 500 | py | Python | Lib/site-packages/plotly/validators/histogram/marker/colorbar/title/_text.py | tytanya/my-first-blog | 2b40adb0816c3546e90ad6ca1e7fb50d924c1536 | [
"bzip2-1.0.6"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/histogram/marker/colorbar/title/_text.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/histogram/marker/colorbar/title/_text.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name='text',
parent_name='histogram.marker.colorbar.title',
**kwargs
):
super(TextValidator, self).__init__(
plotly_name=plotly... | 26.315789 | 66 | 0.61 | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name='text',
parent_name='histogram.marker.colorbar.title',
**kwargs
):
super(TextValidator, self).__init__(
plotly_name=plotly... | true | true |
1c1f6fceff7e0044a89eea8251aa0f7a8cf6baff | 1,943 | py | Python | tests/test/stateful/test_rule.py | ActorForth/brownie | ef0d5af3bb48edcd11abf985626fc99dbc577c7d | [
"MIT"
] | 1,595 | 2020-06-01T19:41:53.000Z | 2022-03-31T16:09:54.000Z | tests/test/stateful/test_rule.py | ActorForth/brownie | ef0d5af3bb48edcd11abf985626fc99dbc577c7d | [
"MIT"
] | 532 | 2020-05-30T12:06:17.000Z | 2022-03-31T22:33:41.000Z | tests/test/stateful/test_rule.py | ActorForth/brownie | ef0d5af3bb48edcd11abf985626fc99dbc577c7d | [
"MIT"
] | 303 | 2020-06-17T00:38:34.000Z | 2022-03-31T10:59:48.000Z | #!/usr/bin/python3
import pytest
from hypothesis import stateful as sf
from brownie.test import state_machine, strategy
def test_rules_run(SMTestBase):
class StateMachine(SMTestBase):
def __init__(self, value):
self.value = value
def rule_one(self):
assert self.value
... | 25.906667 | 72 | 0.650026 |
import pytest
from hypothesis import stateful as sf
from brownie.test import state_machine, strategy
def test_rules_run(SMTestBase):
class StateMachine(SMTestBase):
def __init__(self, value):
self.value = value
def rule_one(self):
assert self.value
def rule_two... | true | true |
1c1f7096a730e38518cc4926f52a75376d520678 | 991 | py | Python | app/core/migrations/0002_tag.py | nilold/django-rest-api | 33972e0944e0da5d4bd5941ce978e0b459cfad2a | [
"MIT"
] | null | null | null | app/core/migrations/0002_tag.py | nilold/django-rest-api | 33972e0944e0da5d4bd5941ce978e0b459cfad2a | [
"MIT"
] | null | null | null | app/core/migrations/0002_tag.py | nilold/django-rest-api | 33972e0944e0da5d4bd5941ce978e0b459cfad2a | [
"MIT"
] | null | null | null | # Generated by Django 2.1.14 on 2019-11-09 19:39
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("core", "0001_initial"),
]
operations = [
migrations.CreateModel(
... | 26.078947 | 68 | 0.424823 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("core", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="Tag",
fields=[
... | true | true |
1c1f70d3e5f56f32211ccba6463bf3a500a8537a | 207 | py | Python | MyHome/views.py | PeacefulWindy/MyHome | dd2d810c2aeb887bb88fb9bd881f9e145b4c7670 | [
"MIT"
] | null | null | null | MyHome/views.py | PeacefulWindy/MyHome | dd2d810c2aeb887bb88fb9bd881f9e145b4c7670 | [
"MIT"
] | null | null | null | MyHome/views.py | PeacefulWindy/MyHome | dd2d810c2aeb887bb88fb9bd881f9e145b4c7670 | [
"MIT"
] | null | null | null | from django.http.response import JsonResponse
from . import configs
import json
def getWho(request):
data={"code":200,"data":{"who":configs.who},"error":""}
return JsonResponse(data,charset="utf8")
| 25.875 | 59 | 0.719807 | from django.http.response import JsonResponse
from . import configs
import json
def getWho(request):
data={"code":200,"data":{"who":configs.who},"error":""}
return JsonResponse(data,charset="utf8")
| true | true |
1c1f7108cb5a0edb9c9d7586220bdb52b67303de | 12,556 | py | Python | tools/mo/openvino/tools/mo/middle/StridedSliceNormalizer.py | ytorzuk-altran/openvino | 68d460a3bb578a738ba0e4d0e1f2e321afa73ab0 | [
"Apache-2.0"
] | 1 | 2021-02-01T06:35:55.000Z | 2021-02-01T06:35:55.000Z | tools/mo/openvino/tools/mo/middle/StridedSliceNormalizer.py | ytorzuk-altran/openvino | 68d460a3bb578a738ba0e4d0e1f2e321afa73ab0 | [
"Apache-2.0"
] | 55 | 2021-04-19T13:03:05.000Z | 2022-03-31T07:53:35.000Z | tools/mo/openvino/tools/mo/middle/StridedSliceNormalizer.py | ytorzuk-altran/openvino | 68d460a3bb578a738ba0e4d0e1f2e321afa73ab0 | [
"Apache-2.0"
] | 1 | 2022-03-27T06:37:35.000Z | 2022-03-27T06:37:35.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from openvino.tools.mo.ops.split import VariadicSplit
from openvino.tools.mo.front.common.partial_infer.utils import int64_array, dynamic_dimension, dynamic_dimension_value, \
is_dynamic_slice
from openvino.tools.... | 50.023904 | 121 | 0.595811 |
import numpy as np
from openvino.tools.mo.ops.split import VariadicSplit
from openvino.tools.mo.front.common.partial_infer.utils import int64_array, dynamic_dimension, dynamic_dimension_value, \
is_dynamic_slice
from openvino.tools.mo.front.tf.graph_utils import create_op_with_const_inputs
from openvino.tools.m... | true | true |
1c1f739163abea5dd631d00d26af2a964a65ee85 | 10,409 | py | Python | anomaly_detection/prophet_model.py | GitHubEmploy/tsad | 63181f40209beb3f943b4a0905513455481f71f4 | [
"MIT"
] | 7 | 2020-09-14T13:02:43.000Z | 2022-02-12T22:19:45.000Z | anomaly_detection/prophet_model.py | GitHubEmploy/tsad | 63181f40209beb3f943b4a0905513455481f71f4 | [
"MIT"
] | null | null | null | anomaly_detection/prophet_model.py | GitHubEmploy/tsad | 63181f40209beb3f943b4a0905513455481f71f4 | [
"MIT"
] | 3 | 2020-09-14T13:02:45.000Z | 2021-07-29T19:53:12.000Z | from pandas import DataFrame, Series
from fbprophet import Prophet
import random
import numpy as np
from itertools import product
import pandas as pd
import threading
from multiprocessing import cpu_count
from functions import *
from utils import *
from logger import LoggerProcess
def get_anomaly(fact, yhat_upper, y... | 44.482906 | 128 | 0.56749 | from pandas import DataFrame, Series
from fbprophet import Prophet
import random
import numpy as np
from itertools import product
import pandas as pd
import threading
from multiprocessing import cpu_count
from functions import *
from utils import *
from logger import LoggerProcess
def get_anomaly(fact, yhat_upper, y... | true | true |
1c1f73a0bd10ae61b42e1ea9e1ac9845aa198b15 | 15,700 | py | Python | tests/netconf/netconf_protocol_test.py | vmizoules/fake-switches | 4ed157c14ff647cd166e2819e8f5d7a0fb53a014 | [
"Apache-2.0"
] | 1 | 2021-02-05T02:08:32.000Z | 2021-02-05T02:08:32.000Z | tests/netconf/netconf_protocol_test.py | Raizo62/fake-switches | e7d769d864fd1400c1fe11bb67c785bd0dc11d58 | [
"Apache-2.0"
] | null | null | null | tests/netconf/netconf_protocol_test.py | Raizo62/fake-switches | e7d769d864fd1400c1fe11bb67c785bd0dc11d58 | [
"Apache-2.0"
] | null | null | null | import logging
import re
import sys
import unittest
from fake_switches.netconf import RUNNING, dict_2_etree
from fake_switches.netconf.capabilities import filter_content
from fake_switches.netconf.netconf_protocol import NetconfProtocol
from hamcrest import assert_that, ends_with, equal_to, has_length, has_key
from ha... | 35.844749 | 197 | 0.473503 | import logging
import re
import sys
import unittest
from fake_switches.netconf import RUNNING, dict_2_etree
from fake_switches.netconf.capabilities import filter_content
from fake_switches.netconf.netconf_protocol import NetconfProtocol
from hamcrest import assert_that, ends_with, equal_to, has_length, has_key
from ha... | true | true |
1c1f748be2dc9944ade52ee69ead6b4145b3a875 | 11,270 | py | Python | spore_api/parsers.py | LEv145/SporeApi | 5c526877300ea6762281f261dab6de1ce4aef469 | [
"MIT"
] | 13 | 2021-11-05T14:38:25.000Z | 2021-11-07T17:58:14.000Z | spore_api/parsers.py | LEv145/spore.py | 5c526877300ea6762281f261dab6de1ce4aef469 | [
"MIT"
] | 1 | 2021-11-05T14:16:39.000Z | 2021-11-05T14:16:39.000Z | spore_api/parsers.py | LEv145/spore.py | 5c526877300ea6762281f261dab6de1ce4aef469 | [
"MIT"
] | 1 | 2021-11-05T14:08:44.000Z | 2021-11-05T14:08:44.000Z | import re
import json
from typing import Any, Dict, List
from pathlib import Path
import xmltodict
from spore_api.constants import BASE_URL
from .utils import datatime_from_string, find_dict_by_value
from .enums import AssetType, AssetSubtype
from .models import (
Achievement,
Achievements,
AssetComments... | 27.82716 | 94 | 0.53496 | import re
import json
from typing import Any, Dict, List
from pathlib import Path
import xmltodict
from spore_api.constants import BASE_URL
from .utils import datatime_from_string, find_dict_by_value
from .enums import AssetType, AssetSubtype
from .models import (
Achievement,
Achievements,
AssetComments... | true | true |
1c1f7514d7cc9f229afac7a5ee01f297ecca893e | 2,908 | py | Python | app/services/users.py | willfong/docker-fastapi-sqlite | 07409f5a5731cc1d4147800140eeba19b22e29dd | [
"MIT"
] | null | null | null | app/services/users.py | willfong/docker-fastapi-sqlite | 07409f5a5731cc1d4147800140eeba19b22e29dd | [
"MIT"
] | 1 | 2020-03-22T11:16:14.000Z | 2020-04-21T19:07:20.000Z | app/services/users.py | willfong/docker-fastapi-sqlite | 07409f5a5731cc1d4147800140eeba19b22e29dd | [
"MIT"
] | null | null | null | import os
import hashlib
import requests
import json
from ..services import util, sqlite
def get_details(id):
query = "SELECT * FROM users WHERE id = ?"
params = (id,)
return sqlite.read(query, params, one=True)
def lookup(oauth):
query = "SELECT * FROM users WHERE oauth = ?"
params = (oauth,)
... | 40.957746 | 209 | 0.706671 | import os
import hashlib
import requests
import json
from ..services import util, sqlite
def get_details(id):
query = "SELECT * FROM users WHERE id = ?"
params = (id,)
return sqlite.read(query, params, one=True)
def lookup(oauth):
query = "SELECT * FROM users WHERE oauth = ?"
params = (oauth,)
... | true | true |
1c1f753e8e7f631ed5cfd28adec16bb2f1d335fa | 1,256 | py | Python | sec_4.1_using_custom_models/params.py | Anonymous-ARR/code | ede7a3b73cb97905454c21d2f9260a788751f8d8 | [
"MIT"
] | null | null | null | sec_4.1_using_custom_models/params.py | Anonymous-ARR/code | ede7a3b73cb97905454c21d2f9260a788751f8d8 | [
"MIT"
] | null | null | null | sec_4.1_using_custom_models/params.py | Anonymous-ARR/code | ede7a3b73cb97905454c21d2f9260a788751f8d8 | [
"MIT"
] | null | null | null | import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--seed", type=int, default=4214)
parser.add_argument("--test_mode", type=str, default="True")
# parser.add_argument("--dataset_path", type=str, default="data")
parser.add_argument("--batch_size", type=int, default=5)
parser.add_argument("--lr", ... | 44.857143 | 145 | 0.742834 | import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--seed", type=int, default=4214)
parser.add_argument("--test_mode", type=str, default="True")
parser.add_argument("--batch_size", type=int, default=5)
parser.add_argument("--lr", type=float, default=3e-4)
parser.add_argument("--n_epochs", type=... | true | true |
1c1f758b2919ea57d8dc3a16c9134d681b7f2c36 | 50,342 | py | Python | tests/integration/helpers/cluster.py | bluebirddm/ClickHouse | f53da4d36b8c3a214567c935caed478edce08363 | [
"Apache-2.0"
] | 2 | 2020-02-12T12:34:14.000Z | 2021-06-05T18:40:33.000Z | tests/integration/helpers/cluster.py | bluebirddm/ClickHouse | f53da4d36b8c3a214567c935caed478edce08363 | [
"Apache-2.0"
] | 1 | 2020-06-29T04:54:52.000Z | 2020-06-29T04:54:52.000Z | tests/integration/helpers/cluster.py | bluebirddm/ClickHouse | f53da4d36b8c3a214567c935caed478edce08363 | [
"Apache-2.0"
] | 1 | 2020-06-15T13:51:03.000Z | 2020-06-15T13:51:03.000Z | import base64
import distutils.dir_util
import errno
import os
import os.path as p
import pwd
import re
import shutil
import socket
import subprocess
import time
import urllib
import httplib
import requests
import xml.dom.minidom
import logging
import docker
import pprint
import psycopg2
import pymongo
import pymysql
i... | 44.315141 | 223 | 0.613821 | import base64
import distutils.dir_util
import errno
import os
import os.path as p
import pwd
import re
import shutil
import socket
import subprocess
import time
import urllib
import httplib
import requests
import xml.dom.minidom
import logging
import docker
import pprint
import psycopg2
import pymongo
import pymysql
i... | false | true |
1c1f75f776c296c90a5dd823f22bd16880fa1b5c | 3,012 | py | Python | front-end/testsuite-python-lib/Python-3.1/Lib/test/test_grp.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2020-11-26T18:53:46.000Z | 2020-11-26T18:53:46.000Z | front-end/testsuite-python-lib/Python-3.1/Lib/test/test_grp.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | null | null | null | front-end/testsuite-python-lib/Python-3.1/Lib/test/test_grp.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2019-04-11T11:27:01.000Z | 2019-04-11T11:27:01.000Z | """Test script for the grp module."""
import unittest
from test import support
grp = support.import_module('grp')
class GroupDatabaseTestCase(unittest.TestCase):
def check_value(self, value):
# check that a grp tuple has the entries and
# attributes promised by the docs
self.assertEqual(... | 32.042553 | 74 | 0.551129 |
import unittest
from test import support
grp = support.import_module('grp')
class GroupDatabaseTestCase(unittest.TestCase):
def check_value(self, value):
self.assertEqual(len(value), 4)
self.assertEqual(value[0], value.gr_name)
self.assert_(isinstance(value.gr_name, str... | true | true |
1c1f76f5cc6d2ad39a85689cb1507de47508b036 | 1,759 | py | Python | sdk/python/pulumi_azure_native/azuredata/v20200908preview/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/azuredata/v20200908preview/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/azuredata/v20200908preview/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from .data_controller import *
from .get_data_controller import *
from .get_postgres_instance import *
from... | 39.088889 | 107 | 0.707789 |
# Export this package's modules as members:
from .data_controller import *
from .get_data_controller import *
from .get_postgres_instance import *
from .get_sql_managed_instance import *
from .get_sql_server_instance import *
from .postgres_instance import *
from .sql_managed_instance import *
from .sql_server_inst... | true | true |
1c1f77bbb0a0769d808fd93423fcb5cbc2abf648 | 2,545 | py | Python | codes/metrics/model_summary.py | waitxxxx/TecoGAN-PyTorch | 15d87000ed35d2037317144f54fa0e3d64f34e2f | [
"Apache-2.0"
] | 125 | 2020-10-06T00:45:41.000Z | 2022-03-30T10:12:35.000Z | codes/metrics/model_summary.py | waitxxxx/TecoGAN-PyTorch | 15d87000ed35d2037317144f54fa0e3d64f34e2f | [
"Apache-2.0"
] | 26 | 2021-01-02T19:38:59.000Z | 2022-03-29T06:26:36.000Z | codes/metrics/model_summary.py | waitxxxx/TecoGAN-PyTorch | 15d87000ed35d2037317144f54fa0e3d64f34e2f | [
"Apache-2.0"
] | 34 | 2020-10-16T06:36:51.000Z | 2022-03-23T03:06:00.000Z | import torch
import torch.nn as nn
# define which modules to be incorporated
registered_module = [
nn.Conv2d,
nn.ConvTranspose2d,
nn.Conv3d
]
# initialize
registered_hooks, model_info_lst = [], []
def calc_2d_gflops_per_batch(module, out_h, out_w):
""" Calculate flops of conv weights (support group... | 27.663043 | 81 | 0.664047 | import torch
import torch.nn as nn
registered_module = [
nn.Conv2d,
nn.ConvTranspose2d,
nn.Conv3d
]
registered_hooks, model_info_lst = [], []
def calc_2d_gflops_per_batch(module, out_h, out_w):
gflops = 0
if hasattr(module, 'weight'):
bias = 0 if hasattr(module, 'bias') else ... | true | true |
1c1f7a5f1167561c380334c3dc5623b4128cff70 | 1,826 | py | Python | serif/theory/original_text.py | BBN-E/ZS4IE | 357965f3068cfe5098422d8cb0ca4b0f99c99fd4 | [
"Apache-2.0"
] | 7 | 2022-03-24T11:04:08.000Z | 2022-03-31T17:12:46.000Z | serif/theory/original_text.py | BBN-E/ZS4IE | 357965f3068cfe5098422d8cb0ca4b0f99c99fd4 | [
"Apache-2.0"
] | null | null | null | serif/theory/original_text.py | BBN-E/ZS4IE | 357965f3068cfe5098422d8cb0ca4b0f99c99fd4 | [
"Apache-2.0"
] | null | null | null | import sys,re
from serif.theory.serif_offset_theory import SerifOffsetTheory
from serif.xmlio import _SimpleAttribute, _ChildTextElement
def get_patterns_for_illegal_xml_unicode_char():
# https://stackoverflow.com/a/22273639/6254393
_illegal_unichrs = [(0x00, 0x08), (0x0B, 0x0C), (0x0E, 0x1F),
... | 42.465116 | 79 | 0.566813 | import sys,re
from serif.theory.serif_offset_theory import SerifOffsetTheory
from serif.xmlio import _SimpleAttribute, _ChildTextElement
def get_patterns_for_illegal_xml_unicode_char():
_illegal_unichrs = [(0x00, 0x08), (0x0B, 0x0C), (0x0E, 0x1F),
(0x7F, 0x84), (0x86, 0x9F),
... | true | true |
1c1f7bd5dda9b6e80ab8f352c7309f8575e8946e | 13,339 | py | Python | src/lslidar_ws/devel/_setup_util.py | Louis-AD-git/racecar_ws | 3c5cb561d1aee11d80a7f3847e0334e93f345513 | [
"MIT"
] | null | null | null | src/lslidar_ws/devel/_setup_util.py | Louis-AD-git/racecar_ws | 3c5cb561d1aee11d80a7f3847e0334e93f345513 | [
"MIT"
] | null | null | null | src/lslidar_ws/devel/_setup_util.py | Louis-AD-git/racecar_ws | 3c5cb561d1aee11d80a7f3847e0334e93f345513 | [
"MIT"
] | null | null | null | #!/usr/bin/python2
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistri... | 43.734426 | 213 | 0.682285 |
from __future__ import print_function
import argparse
import copy
import errno
import os
import platform
import sys
CATKIN_MARKER_FILE = '.catkin'
system = platform.system()
IS_DARWIN = (system == 'Darwin')
IS_WINDOWS = (system == 'Windows')
PATH_TO_ADD_SUFFIX = ['bin']
if IS_WIN... | true | true |
1c1f7cada358f450e0a084cd93818b99fd61c838 | 116 | py | Python | 2d_mix/models/__init__.py | mikelmh025/self-conditioned-gan | 51713879893b34879a106d6ac964de653c6191e0 | [
"MIT"
] | 145 | 2020-06-18T23:53:42.000Z | 2022-03-29T12:07:16.000Z | 2d_mix/models/__init__.py | mikelmh025/self-conditioned-gan | 51713879893b34879a106d6ac964de653c6191e0 | [
"MIT"
] | 9 | 2020-06-29T06:19:58.000Z | 2022-01-25T13:24:31.000Z | 2d_mix/models/__init__.py | mikelmh025/self-conditioned-gan | 51713879893b34879a106d6ac964de653c6191e0 | [
"MIT"
] | 18 | 2020-06-19T01:41:20.000Z | 2021-10-11T06:19:52.000Z | from models import (cluster)
generator_dict = {'standard': cluster.G}
discriminator_dict = {'standard': cluster.D}
| 23.2 | 44 | 0.75 | from models import (cluster)
generator_dict = {'standard': cluster.G}
discriminator_dict = {'standard': cluster.D}
| true | true |
1c1f7d2bc530877ac37ead8c27f00c0c9861af5b | 1,277 | py | Python | matchzoo/dataloader/dataloader_builder.py | MiaoBao/MatchZoo-py | 752aa448b6df4a9d62eb7e8461481d9bb1c7cc30 | [
"Apache-2.0"
] | 468 | 2019-07-03T02:43:52.000Z | 2022-03-30T05:51:03.000Z | matchzoo/dataloader/dataloader_builder.py | MiaoBao/MatchZoo-py | 752aa448b6df4a9d62eb7e8461481d9bb1c7cc30 | [
"Apache-2.0"
] | 126 | 2019-07-04T15:51:57.000Z | 2021-07-31T13:14:40.000Z | matchzoo/dataloader/dataloader_builder.py | MiaoBao/MatchZoo-py | 752aa448b6df4a9d62eb7e8461481d9bb1c7cc30 | [
"Apache-2.0"
] | 117 | 2019-07-04T11:31:08.000Z | 2022-03-18T12:21:32.000Z | import matchzoo as mz
from matchzoo.dataloader import DataLoader
class DataLoaderBuilder(object):
"""
DataLoader Bulider. In essense a wrapped partial function.
Example:
>>> import matchzoo as mz
>>> padding_callback = mz.dataloader.callbacks.BasicPadding()
>>> builder = mz.datalo... | 31.925 | 75 | 0.618637 | import matchzoo as mz
from matchzoo.dataloader import DataLoader
class DataLoaderBuilder(object):
def __init__(self, **kwargs):
self._kwargs = kwargs
def build(self, dataset, **kwargs) -> DataLoader:
return mz.dataloader.DataLoader(
dataset, **{**self._kwargs, **kwargs}
)... | true | true |
1c1f7d58f4f1bbd9b55a3880c2a086ac7a709016 | 648 | py | Python | Elements/UnderlineHeaderElement.py | rodykon/MDConverter | 408918fd92357d68385cdf7b1242991401e9c67f | [
"MIT"
] | null | null | null | Elements/UnderlineHeaderElement.py | rodykon/MDConverter | 408918fd92357d68385cdf7b1242991401e9c67f | [
"MIT"
] | null | null | null | Elements/UnderlineHeaderElement.py | rodykon/MDConverter | 408918fd92357d68385cdf7b1242991401e9c67f | [
"MIT"
] | null | null | null | import re
from Elements import IElement
from LineIterator import LineIterator
HEADER_ONE_CHAR = "="
NEW_HEADER_FORMAT = "h{}. {}"
FIND_REGEX = r"^(-+|=+)$"
class UnderlineHeaderElement(IElement):
def is_relevant(self, line: str) -> bool:
return re.search(FIND_REGEX, line.strip()) is not None
def re... | 28.173913 | 87 | 0.70679 | import re
from Elements import IElement
from LineIterator import LineIterator
HEADER_ONE_CHAR = "="
NEW_HEADER_FORMAT = "h{}. {}"
FIND_REGEX = r"^(-+|=+)$"
class UnderlineHeaderElement(IElement):
def is_relevant(self, line: str) -> bool:
return re.search(FIND_REGEX, line.strip()) is not None
def re... | true | true |
1c1f7fb431d7b5ea89de922179602d966be8217a | 2,098 | py | Python | fu/basic/TwoPrlCombo.py | mfkiwl/OpenCGRA-1 | 1d898da829b416d850ec9f94e3021ca4171ece5b | [
"BSD-3-Clause"
] | 49 | 2020-09-17T19:22:53.000Z | 2022-03-25T18:55:13.000Z | fu/basic/TwoPrlCombo.py | zslwyuan/OpenCGRA | 06646c8c277fd53ea3a287047ac8a4ce3e466295 | [
"BSD-3-Clause"
] | 8 | 2020-12-30T20:22:29.000Z | 2022-03-29T04:47:27.000Z | fu/basic/TwoPrlCombo.py | zslwyuan/OpenCGRA | 06646c8c277fd53ea3a287047ac8a4ce3e466295 | [
"BSD-3-Clause"
] | 12 | 2020-12-12T21:38:59.000Z | 2022-03-15T02:21:15.000Z | """
==========================================================================
TwoSeqComb.py
==========================================================================
Simple generic two parallelly combined functional units for CGRA tile.
Author : Cheng Tan
Date : November 28, 2019
"""
from pymtl3 impo... | 36.172414 | 76 | 0.554814 |
from pymtl3 import *
from pymtl3.stdlib.ifcs import SendIfcRTL, RecvIfcRTL
from ...lib.opt_type import *
class TwoPrlCombo( Component ):
def construct( s, DataType, CtrlType, Fu0, Fu1, num_inports, num_outports,
data_mem_size ):
s.recv_in = [ RecvIfcRTL( DataType ) for _ ... | true | true |
1c1f7fca0e94c25ea3aab994121d64042f85a392 | 68,205 | py | Python | script.module.uncoded/lib/resources/lib/indexers/bennustreams.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | 1 | 2019-03-05T09:38:10.000Z | 2019-03-05T09:38:10.000Z | script.module.uncoded/lib/resources/lib/indexers/bennustreams.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | null | null | null | script.module.uncoded/lib/resources/lib/indexers/bennustreams.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | 1 | 2021-11-05T20:48:09.000Z | 2021-11-05T20:48:09.000Z | # -*- coding: utf-8 -*-
'''
bennu Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program... | 45.019802 | 498 | 0.498263 |
import os,re,sys,hashlib,urllib,urlparse,json,base64,random,datetime
import xbmc,xbmcgui
try: from sqlite3 import dbapi2 as database
except: from pysqlite2 import dbapi2 as database
from resources.lib.modules import debrid
from resources.lib.modules import cache
from resources.lib.modules import metacache
from re... | true | true |
1c1f8112bfb79f702adaeeef8d0278b14ac69d9b | 1,745 | py | Python | replay_buffer.py | Kirkados/Field_Robotics_2021 | 26823b75d303386a17c06b643a471a771e342779 | [
"MIT"
] | 4 | 2020-12-04T08:15:51.000Z | 2021-12-18T05:11:22.000Z | replay_buffer.py | Kirkados/Field_Robotics_2021 | 26823b75d303386a17c06b643a471a771e342779 | [
"MIT"
] | 1 | 2021-09-27T21:20:43.000Z | 2021-09-30T09:55:04.000Z | replay_buffer.py | Kirkados/Field_Robotics_2021 | 26823b75d303386a17c06b643a471a771e342779 | [
"MIT"
] | 6 | 2020-12-04T08:15:59.000Z | 2022-03-05T03:44:34.000Z | """
Generates and manages the large experience replay buffer.
The experience replay buffer holds all the data that is dumped into it from the
many agents who are running episodes of their own. The learner then trains off
this heap of data continually and in its own thread.
@author: Kirk Hovell (khovell@gmail.com)
"... | 34.9 | 103 | 0.667622 |
import random
import numpy as np
from collections import deque
from settings import Settings
class ReplayBuffer():
def __init__(self):
self.buffer = deque(maxlen = Settings.REPLAY_BUFFER_SIZE)
def how_filled(self):
return len(self.buffer)
def add(self, ... | true | true |
1c1f8161c0df726dd8cd7b206defb138434a69aa | 6,879 | py | Python | pytorch_lightning/loggers/tensorboard.py | muhyun/pytorch-lightning | 5fda9da7b415c1812423f27d0d8d89a0b829015c | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/loggers/tensorboard.py | muhyun/pytorch-lightning | 5fda9da7b415c1812423f27d0d8d89a0b829015c | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/loggers/tensorboard.py | muhyun/pytorch-lightning | 5fda9da7b415c1812423f27d0d8d89a0b829015c | [
"Apache-2.0"
] | null | null | null | """
TensorBoard
-----------
"""
import os
from argparse import Namespace
from typing import Optional, Dict, Union, Any
from warnings import warn
import torch
from pkg_resources import parse_version
from torch.utils.tensorboard import SummaryWriter
from pytorch_lightning import _logger as log
from pytorch_lightning.c... | 34.742424 | 108 | 0.631342 |
import os
from argparse import Namespace
from typing import Optional, Dict, Union, Any
from warnings import warn
import torch
from pkg_resources import parse_version
from torch.utils.tensorboard import SummaryWriter
from pytorch_lightning import _logger as log
from pytorch_lightning.core.saving import save_hparams_t... | true | true |
1c1f8198c13a53e568d03cd524960b32dd5bea43 | 5,458 | py | Python | tests/test_10_time_util.py | cnelson/pysaml2 | a30e51c271e27e4411a0243b65adbf5d7a3abb07 | [
"Apache-2.0"
] | 249 | 2018-03-01T09:47:04.000Z | 2022-03-26T04:51:26.000Z | tests/test_10_time_util.py | cnelson/pysaml2 | a30e51c271e27e4411a0243b65adbf5d7a3abb07 | [
"Apache-2.0"
] | 416 | 2018-02-21T15:18:35.000Z | 2022-03-04T16:59:36.000Z | tests/test_10_time_util.py | cnelson/pysaml2 | a30e51c271e27e4411a0243b65adbf5d7a3abb07 | [
"Apache-2.0"
] | 203 | 2018-02-21T13:53:12.000Z | 2022-03-08T22:22:17.000Z | #!/usr/bin/env python
import calendar
import datetime
import time
from saml2.time_util import f_quotient, modulo, parse_duration, add_duration
from saml2.time_util import str_to_time, instant, valid, in_a_while
from saml2.time_util import before, after, not_before, not_on_or_after
def test_f_quotient():
assert f... | 30.662921 | 88 | 0.601869 |
import calendar
import datetime
import time
from saml2.time_util import f_quotient, modulo, parse_duration, add_duration
from saml2.time_util import str_to_time, instant, valid, in_a_while
from saml2.time_util import before, after, not_before, not_on_or_after
def test_f_quotient():
assert f_quotient(0, 3) == 0
... | true | true |
1c1f83273b11cf36f31fe1dd15837e5d0c7b51bb | 1,096 | py | Python | airflow/sensors/date_time_sensor.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 79 | 2021-10-15T07:32:27.000Z | 2022-03-28T04:10:19.000Z | airflow/sensors/date_time_sensor.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 153 | 2021-10-15T05:23:46.000Z | 2022-02-23T06:07:10.000Z | airflow/sensors/date_time_sensor.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 23 | 2021-10-15T02:36:37.000Z | 2022-03-17T02:59:27.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 39.142857 | 106 | 0.771898 |
import warnings
from airflow.sensors.date_time import DateTimeSensor
warnings.warn(
"This module is deprecated. Please use `airflow.sensors.date_time`.", DeprecationWarning, stacklevel=2
)
| true | true |
1c1f84b5b95a0ecb678da029a1deddaa1ae3b08a | 13,911 | py | Python | tests/callbacks/test_pruning.py | Y0mingZhang/pytorch-lightning | f9b9cdb0d1d4e26d25fe13f19f12ea88690aa0a8 | [
"Apache-2.0"
] | 2 | 2021-11-11T12:34:18.000Z | 2021-11-17T08:34:14.000Z | tests/callbacks/test_pruning.py | Y0mingZhang/pytorch-lightning | f9b9cdb0d1d4e26d25fe13f19f12ea88690aa0a8 | [
"Apache-2.0"
] | 1 | 2020-12-08T09:00:55.000Z | 2020-12-08T09:00:55.000Z | tests/callbacks/test_pruning.py | Y0mingZhang/pytorch-lightning | f9b9cdb0d1d4e26d25fe13f19f12ea88690aa0a8 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# 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 i... | 41.156805 | 183 | 0.699662 |
import re
from collections import OrderedDict
from logging import INFO
from typing import Union
import pytest
import torch
import torch.nn.utils.prune as pytorch_prune
from torch import nn
from torch.nn import Sequential
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import ModelC... | true | true |
1c1f851a000c282fe4316b345158c0934c80d254 | 9,025 | py | Python | lale/lib/sklearn/feature_agglomeration.py | vickyvishal/lale | ff9d3666201648354a191ce30d3206151595d813 | [
"Apache-2.0"
] | 1 | 2021-07-24T20:35:18.000Z | 2021-07-24T20:35:18.000Z | lale/lib/sklearn/feature_agglomeration.py | tauseefhashmi/lale | b8ed10b2395fbc9d62a5007a2f11891692c449f3 | [
"Apache-2.0"
] | null | null | null | lale/lib/sklearn/feature_agglomeration.py | tauseefhashmi/lale | b8ed10b2395fbc9d62a5007a2f11891692c449f3 | [
"Apache-2.0"
] | 1 | 2021-03-16T08:20:30.000Z | 2021-03-16T08:20:30.000Z | # Copyright 2019 IBM 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 writing, ... | 39.069264 | 223 | 0.514017 |
import numpy as np
import sklearn
import sklearn.cluster
import lale.docstrings
import lale.operators
_hyperparams_schema = {
"description": "Agglomerate features.",
"allOf": [
{
"type": "object",
"required": ["memory", "compute_full_tree", "pooling_func"],
... | true | true |
1c1f85836442da77c09baafef08407d37e19deb1 | 19,754 | py | Python | warsa/timeseries/timeseries.py | JRoehrig/pywarsa | d2fcc6cebbadaff742bf2ac870a01b0cb534ebde | [
"MIT"
] | null | null | null | warsa/timeseries/timeseries.py | JRoehrig/pywarsa | d2fcc6cebbadaff742bf2ac870a01b0cb534ebde | [
"MIT"
] | null | null | null | warsa/timeseries/timeseries.py | JRoehrig/pywarsa | d2fcc6cebbadaff742bf2ac870a01b0cb534ebde | [
"MIT"
] | 1 | 2020-12-17T15:49:13.000Z | 2020-12-17T15:49:13.000Z | import os
import calendar
import numpy as np
import pandas as pd
from pandas import ExcelWriter
from os.path import splitext, dirname
from datetime import datetime
from dateutil.relativedelta import relativedelta
from warsa.utils.osu import create_directory
def to_open_interval(dt):
return pd.Timestamp(dt) + pd.T... | 38.657534 | 128 | 0.645085 | import os
import calendar
import numpy as np
import pandas as pd
from pandas import ExcelWriter
from os.path import splitext, dirname
from datetime import datetime
from dateutil.relativedelta import relativedelta
from warsa.utils.osu import create_directory
def to_open_interval(dt):
return pd.Timestamp(dt) + pd.T... | false | true |
1c1f86fcfbb7965dc6d118578a794f506556449b | 1,210 | py | Python | app/core/tests/test_models.py | anacg-travelperk/recipe-app-api | 2be7aadef8f17a36fdcf12754154d8d1833dc792 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | anacg-travelperk/recipe-app-api | 2be7aadef8f17a36fdcf12754154d8d1833dc792 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | anacg-travelperk/recipe-app-api | 2be7aadef8f17a36fdcf12754154d8d1833dc792 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
class Modeltests(TestCase):
def test_create_user_with_email_successfull(self):
"""Test creating a new user with an email is successfull"""
email = "test@test.com"
password = "Testpass123"
user = get_use... | 36.666667 | 84 | 0.690083 | from django.test import TestCase
from django.contrib.auth import get_user_model
class Modeltests(TestCase):
def test_create_user_with_email_successfull(self):
email = "test@test.com"
password = "Testpass123"
user = get_user_model().objects.create_user(email=email, password=password)
... | true | true |
1c1f8703241fa7f92b40dc3df42523b485709300 | 7,072 | py | Python | cogs/Mods.py | Moonlington/Luna | 5d94acc5af6a63dcb1335fc87f88903c395744e1 | [
"Apache-2.0"
] | 9 | 2016-07-31T21:25:38.000Z | 2021-11-05T22:20:46.000Z | cogs/Mods.py | rrosajp/Luna | 04d1f9075d5f0b2b0b6d1bdcbdf464e8b368872b | [
"Apache-2.0"
] | null | null | null | cogs/Mods.py | rrosajp/Luna | 04d1f9075d5f0b2b0b6d1bdcbdf464e8b368872b | [
"Apache-2.0"
] | 8 | 2016-10-19T17:17:56.000Z | 2022-03-13T07:21:10.000Z | import discord
from discord.ext import commands
from cogs.utils import checks
import asyncio
import string
import re
def setup(bot):
bot.add_cog(Mods(bot))
class Mods:
def __init__(self, bot):
self.bot = bot
def findUserseverywhere(self, query):
mentionregex = "<@!?(\d+)>"
us... | 39.071823 | 141 | 0.57763 | import discord
from discord.ext import commands
from cogs.utils import checks
import asyncio
import string
import re
def setup(bot):
bot.add_cog(Mods(bot))
class Mods:
def __init__(self, bot):
self.bot = bot
def findUserseverywhere(self, query):
mentionregex = "<@!?(\d+)>"
us... | true | true |
1c1f887712f11d890686b2f8947a2f0fa5789e76 | 636 | py | Python | songmam/models/webhook/events/echo.py | codustry/songmam | b461799f69428e4fd5e47e1c234d28a75832e76a | [
"0BSD"
] | 7 | 2020-11-13T02:31:04.000Z | 2021-11-20T10:48:47.000Z | songmam/models/webhook/events/echo.py | codustry/songmam | b461799f69428e4fd5e47e1c234d28a75832e76a | [
"0BSD"
] | 108 | 2020-11-18T07:01:30.000Z | 2022-03-30T14:06:24.000Z | songmam/models/webhook/events/echo.py | codustry/songmam | b461799f69428e4fd5e47e1c234d28a75832e76a | [
"0BSD"
] | 1 | 2021-11-20T10:48:51.000Z | 2021-11-20T10:48:51.000Z | from typing import Optional
from songmam.models.webhook.events.messages import Message as Message_
from songmam.models.webhook.events.messages import MessagesEvent
class Message(Message_):
is_echo: bool
app_id: str
metadata: Optional[str]
class EchoEntry(MessagesEvent):
message: Message
# {
# "... | 19.272727 | 70 | 0.647799 | from typing import Optional
from songmam.models.webhook.events.messages import Message as Message_
from songmam.models.webhook.events.messages import MessagesEvent
class Message(Message_):
is_echo: bool
app_id: str
metadata: Optional[str]
class EchoEntry(MessagesEvent):
message: Message
... | true | true |
1c1f889b4aae32227616ec26f5e4d42c9f957ece | 608 | py | Python | src/charma/persons/directors/exceptions.py | mononobi/charma-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 1 | 2020-01-16T23:36:10.000Z | 2020-01-16T23:36:10.000Z | src/charma/persons/directors/exceptions.py | mononobi/imovie-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 24 | 2020-06-08T18:27:04.000Z | 2021-06-06T12:01:39.000Z | src/charma/persons/directors/exceptions.py | mononobi/charma-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 1 | 2020-12-20T05:29:04.000Z | 2020-12-20T05:29:04.000Z | # -*- coding: utf-8 -*-
"""
directors exceptions module.
"""
from pyrin.core.exceptions import CoreException, CoreBusinessException
class DirectorsException(CoreException):
"""
directors exception.
"""
pass
class DirectorsBusinessException(CoreBusinessException, DirectorsException):
"""
dir... | 17.371429 | 76 | 0.697368 |
from pyrin.core.exceptions import CoreException, CoreBusinessException
class DirectorsException(CoreException):
pass
class DirectorsBusinessException(CoreBusinessException, DirectorsException):
pass
class DirectorDoesNotExistError(DirectorsBusinessException):
pass
class InvalidDirectorHookTypeErro... | true | true |
1c1f88caa6b165584c22326e753fbd8294cb0088 | 12,766 | py | Python | tests/unit/fake_data_root/openstack/var/lib/juju/agents/unit-neutron-openvswitch-1/charm/unit_tests/test_neutron_ovs_hooks.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 6 | 2021-10-01T19:46:14.000Z | 2022-03-31T17:05:08.000Z | tests/unit/fake_data_root/openstack/var/lib/juju/agents/unit-neutron-openvswitch-1/charm/unit_tests/test_neutron_ovs_hooks.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 111 | 2021-10-01T18:18:17.000Z | 2022-03-29T12:23:20.000Z | tests/unit/fake_data_root/openstack/var/lib/juju/agents/unit-neutron-openvswitch-1/charm/unit_tests/test_neutron_ovs_hooks.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 10 | 2021-09-29T14:47:54.000Z | 2022-03-18T14:52:16.000Z | # Copyright 2016 Canonical Ltd
#
# 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, s... | 40.398734 | 79 | 0.653454 |
from unittest.mock import MagicMock, patch, mock_open
from test_utils import CharmTestCase
with patch('charmhelpers.core.hookenv.config') as config:
config.return_value = 'neutron'
with patch('charmhelpers.contrib.openstack.context.HostInfoContext'):
import neutron_ovs_utils as utils
_r... | true | true |
1c1f88eab6881100bf2d43d88043eba231595627 | 10,726 | py | Python | python/ql/test/library-tests/frameworks/flask/taint_test.py | madhurimamandal/codeql | 76bf8878da4d951ed98238b7239c199a3dfddf16 | [
"MIT"
] | 4,036 | 2020-04-29T00:09:57.000Z | 2022-03-31T14:16:38.000Z | python/ql/test/library-tests/frameworks/flask/taint_test.py | madhurimamandal/codeql | 76bf8878da4d951ed98238b7239c199a3dfddf16 | [
"MIT"
] | 2,970 | 2020-04-28T17:24:18.000Z | 2022-03-31T22:40:46.000Z | python/ql/test/library-tests/frameworks/flask/taint_test.py | ScriptBox99/github-codeql | 2ecf0d3264db8fb4904b2056964da469372a235c | [
"MIT"
] | 794 | 2020-04-29T00:28:25.000Z | 2022-03-30T08:21:46.000Z | from flask import Flask, request
app = Flask(__name__)
@app.route("/test_taint/<name>/<int:number>") # $routeSetup="/test_taint/<name>/<int:number>"
def test_taint(name = "World!", number="0", foo="foo"): # $requestHandler routedParameter=name routedParameter=number
ensure_tainted(name, number) # $ tainted
e... | 35.993289 | 143 | 0.644043 | from flask import Flask, request
app = Flask(__name__)
@app.route("/test_taint/<name>/<int:number>")
def test_taint(name = "World!", number="0", foo="foo"):
ensure_tainted(name, number)
ensure_not_tainted(foo)
ainted(
request.environ,
request.environ.get('HTTP_AUTHORIZATION'), ... | true | true |
1c1f89098c61f755d2afdec5fe641102418895b3 | 1,891 | py | Python | WeMory/post/views.py | Mactto/WEMORY-Backend | 8f628a76c62301e3c9239d5cd975da9040c5baa2 | [
"MIT"
] | 6 | 2021-04-25T23:26:36.000Z | 2022-01-30T06:07:45.000Z | WeMory/post/views.py | yulhee741/WEMORY-Backend | e4a08be71fbab0991e5b4eca693d9db6e464d5e7 | [
"MIT"
] | null | null | null | WeMory/post/views.py | yulhee741/WEMORY-Backend | e4a08be71fbab0991e5b4eca693d9db6e464d5e7 | [
"MIT"
] | 5 | 2021-04-25T08:21:40.000Z | 2021-04-30T13:30:59.000Z | from django.shortcuts import render
from rest_framework.decorators import api_view
from rest_framework.response import Response
from .serializers import PostSerializer
from .models import Post
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny
from django.... | 38.591837 | 109 | 0.720254 | from django.shortcuts import render
from rest_framework.decorators import api_view
from rest_framework.response import Response
from .serializers import PostSerializer
from .models import Post
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny
from django.... | true | true |
1c1f896b1a8e0cf419dc7d2a677b59977e0e40fb | 1,987 | py | Python | setup.py | Berumotto1/ml-platform-sdk-python | fc30300552bbeed5d97e8846beb040c9d262d23e | [
"MIT"
] | null | null | null | setup.py | Berumotto1/ml-platform-sdk-python | fc30300552bbeed5d97e8846beb040c9d262d23e | [
"MIT"
] | null | null | null | setup.py | Berumotto1/ml-platform-sdk-python | fc30300552bbeed5d97e8846beb040c9d262d23e | [
"MIT"
] | null | null | null | import os
import setuptools
NAME = "volcengine_ml_platform"
VERSION = "1.0.3"
description = "Volcengine ML Platform API client library"
setup_requires = ["setuptools>=41.0.0"]
install_requires = [
"volcengine>=1.0.19",
"boto3>=1.18.29",
"requests>=2.18.0",
"six>=1.11.0",
"Pillow>=4.0.0",
"nu... | 27.597222 | 71 | 0.646704 | import os
import setuptools
NAME = "volcengine_ml_platform"
VERSION = "1.0.3"
description = "Volcengine ML Platform API client library"
setup_requires = ["setuptools>=41.0.0"]
install_requires = [
"volcengine>=1.0.19",
"boto3>=1.18.29",
"requests>=2.18.0",
"six>=1.11.0",
"Pillow>=4.0.0",
"nu... | true | true |
1c1f8a1bf9cabd913b271e53a84b460754fcd617 | 2,407 | py | Python | rakit.py | devvspaces/mailfinder | a4d50a0d3bf80741e33df69c74c94daffebc435b | [
"MIT"
] | null | null | null | rakit.py | devvspaces/mailfinder | a4d50a0d3bf80741e33df69c74c94daffebc435b | [
"MIT"
] | null | null | null | rakit.py | devvspaces/mailfinder | a4d50a0d3bf80741e33df69c74c94daffebc435b | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
from requests import Session
from robobrowser import RoboBrowser
from lxml import html
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
session = Session()
useragent = 'Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build... | 28.317647 | 229 | 0.751973 | import requests
from bs4 import BeautifulSoup
from requests import Session
from robobrowser import RoboBrowser
from lxml import html
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
session = Session()
useragent = 'Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build... | true | true |
1c1f8a4248eca3ec591f4199a0fd1d0ce8e22bda | 31,144 | py | Python | electrum_ltc/gui/qt/util.py | Alcofribas4/electrum-ltc-satochip | e78eba47654d96b3d445c1ecad04de6a74bce153 | [
"MIT"
] | null | null | null | electrum_ltc/gui/qt/util.py | Alcofribas4/electrum-ltc-satochip | e78eba47654d96b3d445c1ecad04de6a74bce153 | [
"MIT"
] | 1 | 2021-06-02T00:17:09.000Z | 2021-06-02T00:17:09.000Z | electrum_ltc/gui/qt/util.py | geekfil/electrum-ltc | 054347e6d6c03d823d361469772726a68ff459be | [
"MIT"
] | null | null | null | import asyncio
import os.path
import time
import sys
import platform
import queue
import traceback
import os
import webbrowser
from functools import partial, lru_cache
from typing import NamedTuple, Callable, Optional, TYPE_CHECKING, Union, List, Dict
from PyQt5.QtGui import (QFont, QColor, QCursor, QPixmap, QStandar... | 34.566038 | 124 | 0.628018 | import asyncio
import os.path
import time
import sys
import platform
import queue
import traceback
import os
import webbrowser
from functools import partial, lru_cache
from typing import NamedTuple, Callable, Optional, TYPE_CHECKING, Union, List, Dict
from PyQt5.QtGui import (QFont, QColor, QCursor, QPixmap, QStandar... | true | true |
1c1f8b5b1c9b00fd7744e2703b3fc9c3aaff1b21 | 28,978 | py | Python | mTransKey/seed.py | Nua07/mTransKey | 8176b652603d769f2243aaa36664485de767c210 | [
"MIT"
] | 19 | 2021-07-23T15:55:12.000Z | 2022-02-15T08:20:26.000Z | mTransKey/seed.py | Dollar3795/Request-Cultureland | ebbb8d9e974026144fc60b8bded487e3fd5fcc92 | [
"MIT"
] | 1 | 2022-03-19T16:46:08.000Z | 2022-03-20T03:39:31.000Z | mTransKey/seed.py | Dollar3795/Request-Cultureland | ebbb8d9e974026144fc60b8bded487e3fd5fcc92 | [
"MIT"
] | 6 | 2021-07-23T13:18:28.000Z | 2021-09-15T07:02:59.000Z | import struct
from ctypes import *
SS0 = [696885672, 92635524, 382128852, 331600848, 340021332, 487395612, 747413676, 621093156, 491606364, 54739776, 403181592, 504238620, 289493328, 1020063996, 181060296, 591618912, 671621160, 71581764, 536879136, 495817116, 549511392, 583197408, 147374280, 386339604,
629514... | 22.853312 | 269 | 0.493029 | import struct
from ctypes import *
SS0 = [696885672, 92635524, 382128852, 331600848, 340021332, 487395612, 747413676, 621093156, 491606364, 54739776, 403181592, 504238620, 289493328, 1020063996, 181060296, 591618912, 671621160, 71581764, 536879136, 495817116, 549511392, 583197408, 147374280, 386339604,
629514... | true | true |
1c1f8b776ba98680e15ea4249d674dcf5d22932c | 9,472 | py | Python | util.py | AYCHALTZ/AlMusicomposer | cc229aae875ca5f30ddfe5699482ab8572c81e9e | [
"MIT"
] | 31 | 2017-06-21T21:00:57.000Z | 2022-02-05T10:43:50.000Z | util.py | AYCHALTZ/AlMusicomposer | cc229aae875ca5f30ddfe5699482ab8572c81e9e | [
"MIT"
] | null | null | null | util.py | AYCHALTZ/AlMusicomposer | cc229aae875ca5f30ddfe5699482ab8572c81e9e | [
"MIT"
] | 5 | 2018-02-28T19:35:55.000Z | 2022-01-13T05:49:15.000Z | import os
import math
import cPickle
from collections import defaultdict
from random import shuffle
import numpy as np
import tensorflow as tf
import midi_util
import nottingham_util
def parse_midi_directory(input_dir, time_step):
"""
input_dir: data directory full of midi files
time_step: the numbe... | 36.571429 | 119 | 0.602724 | import os
import math
import cPickle
from collections import defaultdict
from random import shuffle
import numpy as np
import tensorflow as tf
import midi_util
import nottingham_util
def parse_midi_directory(input_dir, time_step):
files = [ os.path.join(input_dir, f) for f in os.listdir(input_dir)
... | true | true |
1c1f8bd16ec7b7f630c481b79b5abda63bfd1a2c | 3,467 | py | Python | lib/xos-synchronizer/xossynchronizer/loadmodels.py | iecedge/xos | 566617f676fedcb2602266191c755d191b37018a | [
"Apache-2.0"
] | null | null | null | lib/xos-synchronizer/xossynchronizer/loadmodels.py | iecedge/xos | 566617f676fedcb2602266191c755d191b37018a | [
"Apache-2.0"
] | null | null | null | lib/xos-synchronizer/xossynchronizer/loadmodels.py | iecedge/xos | 566617f676fedcb2602266191c755d191b37018a | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-present Open Networking Foundation
#
# 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 agr... | 37.27957 | 88 | 0.623882 |
import os
from xosconfig import Config
from multistructlog import create_logger
log = create_logger(Config().get("logging"))
class ModelLoadClient(object):
REQUIRE_CLEAN = 0
AUTOMATICALLY_CLEAN = 1
PURGE = 2
def __init__(self, api):
self.api = api
def upload_models(self, n... | true | true |
1c1f8c9a7a8cbd220e854ab57aa51d6a02e6b53f | 1,616 | py | Python | neo4j/python/update/neo4j_update.py | ekzemplaro/data_base_language | e77030367ffc595f1fac8583f03f9a3ce5eb1611 | [
"MIT",
"Unlicense"
] | 3 | 2015-05-12T16:44:27.000Z | 2021-02-09T00:39:24.000Z | neo4j/python/update/neo4j_update.py | ekzemplaro/data_base_language | e77030367ffc595f1fac8583f03f9a3ce5eb1611 | [
"MIT",
"Unlicense"
] | null | null | null | neo4j/python/update/neo4j_update.py | ekzemplaro/data_base_language | e77030367ffc595f1fac8583f03f9a3ce5eb1611 | [
"MIT",
"Unlicense"
] | null | null | null | #! /usr/bin/python
# -*- coding: utf-8 -*-
#
# neo4j_update.py
#
# Apr/01/2013
#
# -------------------------------------------------------------------------
import sys
import string
import datetime
#
sys.path.append ('/var/www/data_base/common/python_common')
sys.path.append ('/var/www/data_base/common/python_com... | 26.491803 | 75 | 0.531559 |
import sys
import string
import datetime
sys.path.append ('/var/www/data_base/common/python_common')
sys.path.append ('/var/www/data_base/common/python_common/lib')
from client import GraphDatabase
from text_manipulate import dict_display_proc
from text_manipulate import dict_update_proc
from text_manipulate... | true | true |
1c1f8cf262e0a3e9b321e1466961d4380815a1b0 | 6,393 | py | Python | src/pyrad_proc/scripts/main_process_data_period.py | jfigui/pyrad | 7811d593bb09a7f8a621c0e8ae3f32c2b85a0254 | [
"BSD-3-Clause"
] | 41 | 2016-12-01T08:46:06.000Z | 2021-06-24T21:14:33.000Z | src/pyrad_proc/scripts/main_process_data_period.py | jfigui/pyrad | 7811d593bb09a7f8a621c0e8ae3f32c2b85a0254 | [
"BSD-3-Clause"
] | 42 | 2017-02-23T14:52:49.000Z | 2021-02-01T10:43:52.000Z | src/pyrad_proc/scripts/main_process_data_period.py | jfigui/pyrad | 7811d593bb09a7f8a621c0e8ae3f32c2b85a0254 | [
"BSD-3-Clause"
] | 21 | 2016-08-25T15:02:12.000Z | 2021-05-27T04:09:40.000Z | #!/usr/bin/env python
"""
================================================
Pyrad: The MeteoSwiss Radar Processing framework
================================================
Welcome to Pyrad!
This program does the daily processing and post-processing over a period of \
time.
To run the processing framework type:
... | 35.516667 | 80 | 0.625215 |
import datetime
import argparse
import atexit
import os
from pyrad.flow import main as pyrad_main
print(__doc__)
def main():
parser = argparse.ArgumentParser(
description='Entry to Pyrad processing framework')
parser.add_argument(
'proc_cfgfile', type=str, help='name of main con... | true | true |
1c1f8d687e5e4289347160ff457846a59b0ed212 | 239 | py | Python | app/libs/enums.py | ModifiedClass/flaskapipermission | f42cdd1c0dd33219aec1572bb063b6c418a5a67d | [
"BSD-3-Clause"
] | null | null | null | app/libs/enums.py | ModifiedClass/flaskapipermission | f42cdd1c0dd33219aec1572bb063b6c418a5a67d | [
"BSD-3-Clause"
] | null | null | null | app/libs/enums.py | ModifiedClass/flaskapipermission | f42cdd1c0dd33219aec1572bb063b6c418a5a67d | [
"BSD-3-Clause"
] | null | null | null | # -*- coding:utf-8 -*-
from enum import Enum
class ClientTypeEnum(Enum):
# 用户邮箱
USER_EMAIL = 100
# 手机号登录
USER_MOBILE = 101
# 昵称登录
USER_NICKNAME = 102
# 小程序登录
USER_MINA = 200
# 微信登录
USER_WX = 201
| 13.277778 | 27 | 0.577406 |
from enum import Enum
class ClientTypeEnum(Enum):
USER_EMAIL = 100
USER_MOBILE = 101
USER_NICKNAME = 102
USER_MINA = 200
USER_WX = 201
| true | true |
1c1f8de5c986caae3036bf419b5a48d9ee8bccac | 2,252 | py | Python | wheat/server/start_farmer.py | grayfallstown/wheat-blockchain | f391cdd30a0cbcdb2adf4439a25581fd28b42c1f | [
"Apache-2.0"
] | null | null | null | wheat/server/start_farmer.py | grayfallstown/wheat-blockchain | f391cdd30a0cbcdb2adf4439a25581fd28b42c1f | [
"Apache-2.0"
] | null | null | null | wheat/server/start_farmer.py | grayfallstown/wheat-blockchain | f391cdd30a0cbcdb2adf4439a25581fd28b42c1f | [
"Apache-2.0"
] | null | null | null | import pathlib
from typing import Dict
from wheat.consensus.constants import ConsensusConstants
from wheat.consensus.default_constants import DEFAULT_CONSTANTS
from wheat.farmer.farmer import Farmer
from wheat.farmer.farmer_api import FarmerAPI
from wheat.rpc.farmer_rpc_api import FarmerRpcApi
from wheat.server.outbou... | 32.637681 | 107 | 0.742007 | import pathlib
from typing import Dict
from wheat.consensus.constants import ConsensusConstants
from wheat.consensus.default_constants import DEFAULT_CONSTANTS
from wheat.farmer.farmer import Farmer
from wheat.farmer.farmer_api import FarmerAPI
from wheat.rpc.farmer_rpc_api import FarmerRpcApi
from wheat.server.outbou... | true | true |
1c1f8f16be54da36bf5d6c492998a540119d5e1f | 28,265 | py | Python | openstack_dashboard/dashboards/identity/users/tests.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | 1 | 2021-01-20T00:14:15.000Z | 2021-01-20T00:14:15.000Z | openstack_dashboard/dashboards/identity/users/tests.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | 1 | 2019-10-27T15:57:25.000Z | 2019-10-27T15:57:25.000Z | openstack_dashboard/dashboards/identity/users/tests.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | 41.383602 | 79 | 0.548877 |
from socket import timeout as socket_timeout
from django.core.urlresolvers import reverse
from django import http
from django.test.utils import override_settings
from mox3.mox import IgnoreArg
from mox3.mox import IsA
from openstack_dashboard import api
from openstack_dashboard.test import he... | true | true |
1c1f900c47402e98f8899fddaec0beea6f1ae884 | 932 | py | Python | config/config_coin.py | szhu3210/Arbitrage-trader | d2af5670f7285084f70e36a48c95e796d1fd2d37 | [
"Apache-2.0"
] | 6 | 2019-04-03T22:33:39.000Z | 2021-05-07T12:00:00.000Z | config/config_coin.py | szhu3210/Arbitrage-trader | d2af5670f7285084f70e36a48c95e796d1fd2d37 | [
"Apache-2.0"
] | 2 | 2019-04-03T22:57:41.000Z | 2019-04-26T07:13:12.000Z | config/config_coin.py | szhu3210/Arbitrage-trader | d2af5670f7285084f70e36a48c95e796d1fd2d37 | [
"Apache-2.0"
] | 1 | 2019-04-28T07:23:32.000Z | 2019-04-28T07:23:32.000Z | currency_list = {
'standard': ['BTC', 'BCH', 'ETH', 'ETC', 'LTC', 'USDT', 'DASH', 'XRP'],
'huobipro': ['BTC', 'BCH', 'ETH', 'ETC', 'LTC', 'USDT', 'DASH', 'XRP'],
'poloniex': ['BTC', 'BCH', 'ETH', 'ETC', 'LTC', 'USDT', 'DASH', 'XRP'],
'okex': ['BTC', 'BCH', 'ETH', 'ETC', 'LTC', 'USDT', 'DASH', 'XRP']... | 38.833333 | 189 | 0.555794 | currency_list = {
'standard': ['BTC', 'BCH', 'ETH', 'ETC', 'LTC', 'USDT', 'DASH', 'XRP'],
'huobipro': ['BTC', 'BCH', 'ETH', 'ETC', 'LTC', 'USDT', 'DASH', 'XRP'],
'poloniex': ['BTC', 'BCH', 'ETH', 'ETC', 'LTC', 'USDT', 'DASH', 'XRP'],
'okex': ['BTC', 'BCH', 'ETH', 'ETC', 'LTC', 'USDT', 'DASH', 'XRP']... | true | true |
1c1f904153e6f093f457213438d6bd3b365cbdac | 375 | py | Python | Python Programs/Bubble_Sort.py | Aditi014/Hacktoberfest2020-Expert | 531702bf7789c409dd2152075d3111208cb48647 | [
"MIT"
] | null | null | null | Python Programs/Bubble_Sort.py | Aditi014/Hacktoberfest2020-Expert | 531702bf7789c409dd2152075d3111208cb48647 | [
"MIT"
] | null | null | null | Python Programs/Bubble_Sort.py | Aditi014/Hacktoberfest2020-Expert | 531702bf7789c409dd2152075d3111208cb48647 | [
"MIT"
] | null | null | null | # Python program for implementation of Bubble Sort
def bubbleSort(arr):
n = len(arr)
for i in range(n):
for j in range(0, n-i-1):
if arr[j] > arr[j+1] :
arr[j], arr[j+1] = arr[j+1], arr[j]
# Driver code to test above
arr = [64, 34, 25, 12, 22, 11, 90]
bubbleSort(arr)
print ("Sorted array is:... | 19.736842 | 51 | 0.578667 |
def bubbleSort(arr):
n = len(arr)
for i in range(n):
for j in range(0, n-i-1):
if arr[j] > arr[j+1] :
arr[j], arr[j+1] = arr[j+1], arr[j]
arr = [64, 34, 25, 12, 22, 11, 90]
bubbleSort(arr)
print ("Sorted array is:")
for i in range(len(arr)):
print ("%d" %arr[i]),
| true | true |
1c1f90f57b7c17d34e3c7e85cc5804a3acf9b565 | 1,014 | py | Python | giadog/src/GymEnvs/TestingFunctions/test_position_orientation.py | eduardo98m/GiaDog | ecafdaaddd1b3ac5cf09cdfc97fba8087385497c | [
"MIT"
] | 3 | 2022-03-12T08:30:34.000Z | 2022-03-14T16:16:51.000Z | giadog/src/GymEnvs/TestingFunctions/test_position_orientation.py | eduardo98m/GiaDog | ecafdaaddd1b3ac5cf09cdfc97fba8087385497c | [
"MIT"
] | null | null | null | giadog/src/GymEnvs/TestingFunctions/test_position_orientation.py | eduardo98m/GiaDog | ecafdaaddd1b3ac5cf09cdfc97fba8087385497c | [
"MIT"
] | null | null | null | """
Authors: Amin Arriaga, Eduardo Lopez
Project: Graduation Thesis: GIAdog
Function for testing the robot position and orientation.
"""
import pyBulletPainter as pbp
import numpy as np
def test_position_orientation(robot, first_exec: bool=False):
"""
Test the position and orientation of the r... | 29.823529 | 77 | 0.645957 | import pyBulletPainter as pbp
import numpy as np
def test_position_orientation(robot, first_exec: bool=False):
p = robot.client
r_o = robot.position
robot.update_position_orientation()
_, pitch, yaw = robot.orientation
x = np.cos(yaw) * np.cos(pitch)
y = np.sin(yaw) * np.cos(pitch)
z... | true | true |
1c1f912ff8af5c444de8a2956daa7ac54a4eecbc | 107,544 | py | Python | Lib/test/test_asyncio/test_tasks.py | hdaugherty/cpython | 27ee0f8551a6d576a65e20da90acf9f3cb412c35 | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2019-05-22T08:19:52.000Z | 2019-05-22T08:19:52.000Z | Lib/test/test_asyncio/test_tasks.py | hdaugherty/cpython | 27ee0f8551a6d576a65e20da90acf9f3cb412c35 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/test/test_asyncio/test_tasks.py | hdaugherty/cpython | 27ee0f8551a6d576a65e20da90acf9f3cb412c35 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | """Tests for tasks.py."""
import collections
import contextlib
import contextvars
import functools
import gc
import io
import random
import re
import sys
import textwrap
import types
import unittest
import weakref
from unittest import mock
import asyncio
from asyncio import coroutines
from asyncio import futures
from... | 32.054844 | 105 | 0.590196 |
import collections
import contextlib
import contextvars
import functools
import gc
import io
import random
import re
import sys
import textwrap
import types
import unittest
import weakref
from unittest import mock
import asyncio
from asyncio import coroutines
from asyncio import futures
from asyncio import tasks
from... | true | true |
1c1f9168b1c7ba7a7095570f3d548494f794a6f9 | 1,139 | py | Python | adminmgr/media/code/python/red2/R.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 9 | 2019-11-08T02:05:27.000Z | 2021-12-13T12:06:35.000Z | adminmgr/media/code/python/red2/R.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 6 | 2019-11-27T03:23:16.000Z | 2021-06-10T19:15:13.000Z | adminmgr/media/code/python/red2/R.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 4 | 2019-11-26T17:04:27.000Z | 2021-12-13T11:57:03.000Z | #!/usr/bin/python3
"""reducer.py"""
from operator import itemgetter
import sys
answer_dict={}
current_batsman = None
current_count = 0
current_out=0
word = None
max_wicket=0
# input comes from STDIN
for line in sys.stdin:
line = line.strip()
batsman,wtype,count = line.split('\t')
try:
count = int(... | 29.205128 | 82 | 0.689201 |
from operator import itemgetter
import sys
answer_dict={}
current_batsman = None
current_count = 0
current_out=0
word = None
max_wicket=0
for line in sys.stdin:
line = line.strip()
batsman,wtype,count = line.split('\t')
try:
count = int(count)
except ValueError:
continue
if current_batsman =... | true | true |
1c1f91b77521c36d9fc2ae4c68e394c891ecb181 | 2,079 | py | Python | python/ray/air/tests/test_huggingface_predictor.py | shrekris-anyscale/ray | d36fd77548e1d83d6510b478f72ac668434458af | [
"Apache-2.0"
] | null | null | null | python/ray/air/tests/test_huggingface_predictor.py | shrekris-anyscale/ray | d36fd77548e1d83d6510b478f72ac668434458af | [
"Apache-2.0"
] | 41 | 2021-09-21T01:13:48.000Z | 2022-03-19T07:12:22.000Z | python/ray/air/tests/test_huggingface_predictor.py | shrekris-anyscale/ray | d36fd77548e1d83d6510b478f72ac668434458af | [
"Apache-2.0"
] | null | null | null | import os
import pandas as pd
import pytest
from transformers import (
AutoConfig,
AutoModelForCausalLM,
AutoTokenizer,
)
from transformers.pipelines import pipeline
import ray
from ray.air.preprocessor import Preprocessor
from ray.air.predictors.integrations.huggingface import HuggingFacePredictor
promp... | 27.355263 | 78 | 0.688312 | import os
import pandas as pd
import pytest
from transformers import (
AutoConfig,
AutoModelForCausalLM,
AutoTokenizer,
)
from transformers.pipelines import pipeline
import ray
from ray.air.preprocessor import Preprocessor
from ray.air.predictors.integrations.huggingface import HuggingFacePredictor
promp... | true | true |
1c1f92aa1caa92c91220314a2fd8161eaa533bd0 | 421 | py | Python | recipes/duktape/all/test_package/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 562 | 2019-09-04T12:23:43.000Z | 2022-03-29T16:41:43.000Z | recipes/duktape/all/test_package/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 9,799 | 2019-09-04T12:02:11.000Z | 2022-03-31T23:55:45.000Z | recipes/duktape/all/test_package/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 1,126 | 2019-09-04T11:57:46.000Z | 2022-03-31T16:43:38.000Z | import os
from conans import CMake, ConanFile, tools
class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def test(self):
if not tools.cross_buil... | 23.388889 | 79 | 0.63658 | import os
from conans import CMake, ConanFile, tools
class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def test(self):
if not tools.cross_buil... | true | true |
1c1f92fdf1d5d80b027b6fd22543dcb7d71890ad | 8,477 | py | Python | tests/test_cosine_greedy.py | adelabriere/matchms | a580539e6db3f4f00e12097983b85b2d494159ba | [
"Apache-2.0"
] | 64 | 2020-06-22T14:59:21.000Z | 2022-03-30T00:50:13.000Z | tests/test_cosine_greedy.py | adelabriere/matchms | a580539e6db3f4f00e12097983b85b2d494159ba | [
"Apache-2.0"
] | 561 | 2020-03-19T14:35:59.000Z | 2022-03-29T10:11:12.000Z | tests/test_cosine_greedy.py | adelabriere/matchms | a580539e6db3f4f00e12097983b85b2d494159ba | [
"Apache-2.0"
] | 32 | 2020-05-06T07:35:59.000Z | 2022-03-10T09:03:45.000Z | import numpy
import pytest
from matchms import Spectrum
from matchms.similarity import CosineGreedy
def test_cosine_greedy_without_parameters():
"""Compare output cosine score with own calculation on simple dummy spectrums."""
spectrum_1 = Spectrum(mz=numpy.array([100, 200, 300, 500, 510], dtype="float"),
... | 55.405229 | 115 | 0.666627 | import numpy
import pytest
from matchms import Spectrum
from matchms.similarity import CosineGreedy
def test_cosine_greedy_without_parameters():
spectrum_1 = Spectrum(mz=numpy.array([100, 200, 300, 500, 510], dtype="float"),
intensities=numpy.array([0.1, 0.2, 1.0, 0.3, 0.4], dtype="float... | true | true |
1c1f93ac0f5c1abc195b53cf1317fd61f8a79ffd | 3,622 | py | Python | project_2/workspace/predict.py | JWThacker/Udacity_Intro_Machine_Learning_Tensorflow_Nanodegree | 1d2b0db9d92d5491173e1d1052acc005721c0ad1 | [
"MIT"
] | null | null | null | project_2/workspace/predict.py | JWThacker/Udacity_Intro_Machine_Learning_Tensorflow_Nanodegree | 1d2b0db9d92d5491173e1d1052acc005721c0ad1 | [
"MIT"
] | null | null | null | project_2/workspace/predict.py | JWThacker/Udacity_Intro_Machine_Learning_Tensorflow_Nanodegree | 1d2b0db9d92d5491173e1d1052acc005721c0ad1 | [
"MIT"
] | null | null | null | import warnings
warnings.filterwarnings('ignore')
import json
import sys
import argparse as ap
import numpy as np
import tensorflow as tf
tf.get_logger().setLevel('WARNING')
tf.autograph.set_verbosity(2)
import tensorflow_hub as hub
import logging
from utils import process_image, predict
'''
Predict the flower sp... | 39.369565 | 112 | 0.547764 | import warnings
warnings.filterwarnings('ignore')
import json
import sys
import argparse as ap
import numpy as np
import tensorflow as tf
tf.get_logger().setLevel('WARNING')
tf.autograph.set_verbosity(2)
import tensorflow_hub as hub
import logging
from utils import process_image, predict
def main():
parser... | true | true |
1c1f93d37e22f2f4075f08e5eede1320aef82f2b | 106,630 | py | Python | test/integration/component/test_vpc_vms_deployment.py | redbridge/cloudstack | 2218053fb11d501950e4beb80e9bee4ae472b5b4 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2015-02-10T07:21:58.000Z | 2021-05-07T08:52:17.000Z | test/integration/component/test_vpc_vms_deployment.py | redbridge/cloudstack | 2218053fb11d501950e4beb80e9bee4ae472b5b4 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2015-06-11T02:17:06.000Z | 2015-06-22T20:46:42.000Z | test/integration/component/test_vpc_vms_deployment.py | redbridge/cloudstack | 2218053fb11d501950e4beb80e9bee4ae472b5b4 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2015-05-25T15:53:52.000Z | 2018-05-23T14:08:07.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 46.482127 | 126 | 0.435187 |
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.lib.base import (VirtualMachine,
NetworkOffering,
VpcOffering,
... | true | true |
1c1f94c5d60ac2edc3c0315b3dee1c78bd8cdb8f | 11,875 | py | Python | homeassistant/components/synology_dsm/const.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 1 | 2021-12-11T00:41:25.000Z | 2021-12-11T00:41:25.000Z | homeassistant/components/synology_dsm/const.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 69 | 2020-08-04T09:03:43.000Z | 2022-03-31T06:13:01.000Z | homeassistant/components/synology_dsm/const.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 1 | 2020-12-13T08:27:33.000Z | 2020-12-13T08:27:33.000Z | """Constants for Synology DSM."""
from __future__ import annotations
from typing import Final, TypedDict
from synology_dsm.api.core.security import SynoCoreSecurity
from synology_dsm.api.core.upgrade import SynoCoreUpgrade
from synology_dsm.api.core.utilization import SynoCoreUtilization
from synology_dsm.api.dsm.inf... | 32.094595 | 85 | 0.68 | from __future__ import annotations
from typing import Final, TypedDict
from synology_dsm.api.core.security import SynoCoreSecurity
from synology_dsm.api.core.upgrade import SynoCoreUpgrade
from synology_dsm.api.core.utilization import SynoCoreUtilization
from synology_dsm.api.dsm.information import SynoDSMInformation... | true | true |
1c1f94fd77ced0338fdc2ab91a9bb2994ba196a4 | 956 | py | Python | karabo_data/tests/test_utils.py | zhujun98/karabo_data | 68ee19d52cd7f140052d029545a7b6169ec9752a | [
"BSD-3-Clause"
] | 13 | 2018-05-03T08:41:06.000Z | 2021-03-21T01:47:26.000Z | karabo_data/tests/test_utils.py | zhujun98/karabo_data | 68ee19d52cd7f140052d029545a7b6169ec9752a | [
"BSD-3-Clause"
] | 175 | 2018-04-27T12:48:37.000Z | 2021-11-26T10:16:14.000Z | karabo_data/tests/test_utils.py | zhujun98/karabo_data | 68ee19d52cd7f140052d029545a7b6169ec9752a | [
"BSD-3-Clause"
] | 7 | 2018-05-03T14:49:44.000Z | 2020-08-21T07:13:48.000Z | import numpy as np
import os
import pytest
import re
import tempfile
from testpath import assert_isfile
from karabo_data import utils
from karabo_data.utils import QuickView
def test_cbf_conversion(mock_agipd_data, capsys):
with tempfile.TemporaryDirectory() as td:
out_file = os.path.join(td, 'out.cbf')
... | 23.9 | 61 | 0.670502 | import numpy as np
import os
import pytest
import re
import tempfile
from testpath import assert_isfile
from karabo_data import utils
from karabo_data.utils import QuickView
def test_cbf_conversion(mock_agipd_data, capsys):
with tempfile.TemporaryDirectory() as td:
out_file = os.path.join(td, 'out.cbf')
... | true | true |
1c1f958c2ce77e1527f3ce185b6ff80cf3eb877c | 3,028 | py | Python | HangMan/hangman.py | technicalreju/Friends_Hack | 5698ea249a4d50b19cc9357c3fe4b643c0eee243 | [
"MIT"
] | 16 | 2020-10-02T15:04:11.000Z | 2021-10-18T14:21:57.000Z | HangMan/hangman.py | UG-SEP/Friends_Hack | b1719389665a4a7d63e6736dca76904180f2f686 | [
"MIT"
] | 26 | 2020-10-02T11:57:42.000Z | 2021-10-06T10:15:28.000Z | HangMan/hangman.py | UG-SEP/Friends_Hack | b1719389665a4a7d63e6736dca76904180f2f686 | [
"MIT"
] | 152 | 2020-10-02T12:05:11.000Z | 2021-10-10T05:49:59.000Z | import random
player_name = input("Enter your name\n")
def man(num):
if num == 1:
return "-----------\n"\
"| 0 |\n"\
"| |\n"\
"| |\n"\
"| |\n"\
"-----------"
elif num == 2:
return "-------... | 30.28 | 83 | 0.338838 | import random
player_name = input("Enter your name\n")
def man(num):
if num == 1:
return "-----------\n"\
"| 0 |\n"\
"| |\n"\
"| |\n"\
"| |\n"\
"-----------"
elif num == 2:
return "-------... | true | true |
1c1f98576553eb95e36e5022b4caae929828493b | 1,678 | py | Python | kvirt/internalplans/__init__.py | jmolmo/kcli | 4660ce5f9b006973c1d170c0005ed704a017afb1 | [
"Apache-2.0"
] | null | null | null | kvirt/internalplans/__init__.py | jmolmo/kcli | 4660ce5f9b006973c1d170c0005ed704a017afb1 | [
"Apache-2.0"
] | null | null | null | kvirt/internalplans/__init__.py | jmolmo/kcli | 4660ce5f9b006973c1d170c0005ed704a017afb1 | [
"Apache-2.0"
] | 1 | 2021-11-15T15:28:18.000Z | 2021-11-15T15:28:18.000Z | haproxy = """
parameters:
image: centos8
name: haproxy
nets:
- default
vms: []
{{ image }}:
type: image
loadbalancer-{{ ports | join('+') }}:
type: profile
image: {{ image }}
nets: {{ nets }}
{{ name }}:
profile: loadbalancer-{{ ports | join('+') }}
files:
- path: /root/haproxy.cfg
content: |
... | 23.971429 | 72 | 0.518474 | haproxy = """
parameters:
image: centos8
name: haproxy
nets:
- default
vms: []
{{ image }}:
type: image
loadbalancer-{{ ports | join('+') }}:
type: profile
image: {{ image }}
nets: {{ nets }}
{{ name }}:
profile: loadbalancer-{{ ports | join('+') }}
files:
- path: /root/haproxy.cfg
content: |
... | true | true |
1c1f987b980876e51302765fbe0fad2000d77ecf | 875 | py | Python | ituro/sumo/admin.py | kayduemre/ituro | eb5bb0655c2d85eed212d28c1d154006c57a4f03 | [
"MIT"
] | 9 | 2015-03-18T01:59:24.000Z | 2022-03-09T06:36:21.000Z | ituro/sumo/admin.py | kayduemre/ituro | eb5bb0655c2d85eed212d28c1d154006c57a4f03 | [
"MIT"
] | 29 | 2015-03-18T01:59:49.000Z | 2021-06-10T20:39:03.000Z | ituro/sumo/admin.py | kayduemre/ituro | eb5bb0655c2d85eed212d28c1d154006c57a4f03 | [
"MIT"
] | 10 | 2016-01-31T05:44:46.000Z | 2019-10-15T06:12:27.000Z | from django.contrib import admin
from sumo.models import *
class SumoGroupAdmin(admin.ModelAdmin):
list_display = ("order", "is_final")
class SumoGroupMatchAdmin(admin.ModelAdmin):
list_display = (
"order", "home", "home_score", "away", "away_score", "group")
class SumoStageAdmin(admin.ModelAdmin)... | 27.34375 | 72 | 0.739429 | from django.contrib import admin
from sumo.models import *
class SumoGroupAdmin(admin.ModelAdmin):
list_display = ("order", "is_final")
class SumoGroupMatchAdmin(admin.ModelAdmin):
list_display = (
"order", "home", "home_score", "away", "away_score", "group")
class SumoStageAdmin(admin.ModelAdmin)... | true | true |
1c1f99deb2e9e9d07472b4d41427f8df70de378d | 44,405 | py | Python | pt/eval.py | ronaldokun/isic2019 | 26d436f7ecd9efbce8834dd01aae02c2a8ad85f6 | [
"MIT"
] | 107 | 2019-10-29T05:58:35.000Z | 2022-03-30T08:17:45.000Z | pt/eval.py | ronaldokun/isic2019 | 26d436f7ecd9efbce8834dd01aae02c2a8ad85f6 | [
"MIT"
] | 6 | 2019-12-19T13:15:02.000Z | 2021-03-21T12:29:15.000Z | pt/eval.py | ronaldokun/isic2019 | 26d436f7ecd9efbce8834dd01aae02c2a8ad85f6 | [
"MIT"
] | 32 | 2019-12-04T16:05:55.000Z | 2022-03-25T17:43:13.000Z | import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
import torchvision
from torchvision import datasets, models as tv_models
from torch.utils.data import DataLoader
from torchsummary import summary
import numpy as np
import models
import threading
import pickle
from pathl... | 59.845013 | 265 | 0.585227 | import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
import torchvision
from torchvision import datasets, models as tv_models
from torch.utils.data import DataLoader
from torchsummary import summary
import numpy as np
import models
import threading
import pickle
from pathl... | true | true |
1c1f9a10cf6bd16bd3d1a693c29fc915dcc077ee | 1,224 | py | Python | google/ads/googleads/v5/services/types/distance_view_service.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v5/services/types/distance_view_service.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v5/services/types/distance_view_service.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 29.142857 | 112 | 0.726307 |
import proto
__protobuf__ = proto.module(
package="google.ads.googleads.v5.services",
marshal="google.ads.googleads.v5",
manifest={"GetDistanceViewRequest",},
)
class GetDistanceViewRequest(proto.Message):
resource_name = proto.Field(proto.STRING, number=1)
__all__ = tuple(sort... | true | true |
1c1f9a5770e5b66b91a95312ea25d0593e737eb2 | 2,923 | py | Python | tests/test_plotting/test_geodesics/test_static.py | bibek22/einsteinpy | 78bf5d942cbb12393852f8e4d7a8426f1ffe6f23 | [
"MIT"
] | null | null | null | tests/test_plotting/test_geodesics/test_static.py | bibek22/einsteinpy | 78bf5d942cbb12393852f8e4d7a8426f1ffe6f23 | [
"MIT"
] | null | null | null | tests/test_plotting/test_geodesics/test_static.py | bibek22/einsteinpy | 78bf5d942cbb12393852f8e4d7a8426f1ffe6f23 | [
"MIT"
] | null | null | null | from unittest import mock
import numpy as np
import pytest
from matplotlib.axes import Axes
from einsteinpy.metric import Schwarzschild
from einsteinpy.coordinates.utils import four_position, stacked_vec
from einsteinpy.geodesic import Geodesic
from einsteinpy.plotting import StaticGeodesicPlotter
@pytest.fixture()... | 27.575472 | 97 | 0.726309 | from unittest import mock
import numpy as np
import pytest
from matplotlib.axes import Axes
from einsteinpy.metric import Schwarzschild
from einsteinpy.coordinates.utils import four_position, stacked_vec
from einsteinpy.geodesic import Geodesic
from einsteinpy.plotting import StaticGeodesicPlotter
@pytest.fixture()... | true | true |
1c1f9a8866f0417f7d81625a0be7af440a1b724f | 2,471 | py | Python | .builder/actions/aws_crt_python.py | lipi/aws-crt-python | 2b849b3b0e7a7345b878fad7a44301bd06d9c062 | [
"Apache-2.0"
] | null | null | null | .builder/actions/aws_crt_python.py | lipi/aws-crt-python | 2b849b3b0e7a7345b878fad7a44301bd06d9c062 | [
"Apache-2.0"
] | null | null | null | .builder/actions/aws_crt_python.py | lipi/aws-crt-python | 2b849b3b0e7a7345b878fad7a44301bd06d9c062 | [
"Apache-2.0"
] | null | null | null |
import Builder
import os
import sys
class InstallPythonReqs(Builder.Action):
def __init__(self, trust_hosts=False, deps=[], python=sys.executable):
self.trust_hosts = trust_hosts
self.core = ('pip', 'setuptools')
self.deps = deps
self.python = python
def run(self, env):
... | 41.881356 | 102 | 0.624848 |
import Builder
import os
import sys
class InstallPythonReqs(Builder.Action):
def __init__(self, trust_hosts=False, deps=[], python=sys.executable):
self.trust_hosts = trust_hosts
self.core = ('pip', 'setuptools')
self.deps = deps
self.python = python
def run(self, env):
... | true | true |
1c1f9aedacbc79521c2be874e347b817772828dd | 11,603 | py | Python | Lib/distutils/command/register.py | raychorn/svn_Python-2.5.1 | 425005b1b489ba44ec0bb989e077297e8953d9be | [
"PSF-2.0"
] | null | null | null | Lib/distutils/command/register.py | raychorn/svn_Python-2.5.1 | 425005b1b489ba44ec0bb989e077297e8953d9be | [
"PSF-2.0"
] | null | null | null | Lib/distutils/command/register.py | raychorn/svn_Python-2.5.1 | 425005b1b489ba44ec0bb989e077297e8953d9be | [
"PSF-2.0"
] | null | null | null | """distutils.command.register
Implements the Distutils 'register' command (register with the repository).
"""
# created 2002/10/21, Richard Jones
__revision__ = "$Id: register.py 52243 2006-10-09 17:13:26Z andrew.kuchling $"
import sys, os, string, urllib2, getpass, urlparse
import StringIO, ConfigParser
... | 39.332203 | 90 | 0.525554 | """distutils.command.register
Implements the Distutils 'register' command (register with the repository).
"""
__revision__ = "$Id: register.py 52243 2006-10-09 17:13:26Z andrew.kuchling $"
import sys, os, string, urllib2, getpass, urlparse
import StringIO, ConfigParser
from distutils.core import Comman... | false | true |
1c1f9b297b75c068b89b4325d0bb9d0abb9fc21e | 430 | py | Python | hothouse/datasets.py | langmm/hothouse | 6b201b65df7cdaaf6535db988ac765a4ad3218ac | [
"MIT"
] | null | null | null | hothouse/datasets.py | langmm/hothouse | 6b201b65df7cdaaf6535db988ac765a4ad3218ac | [
"MIT"
] | 1 | 2020-02-21T19:25:53.000Z | 2020-03-04T23:07:21.000Z | hothouse/datasets.py | langmm/hothouse | 6b201b65df7cdaaf6535db988ac765a4ad3218ac | [
"MIT"
] | 3 | 2020-02-20T02:26:26.000Z | 2020-06-30T23:41:37.000Z | import pooch
# Going to set this up a bit later...
from . import __version__
_registry = {
"fullSoy_2-12a.ply": "e12f192188058851289f0531dc456c6df31b562405b77e382e0f9e4b1c899108"
}
PLANTS = pooch.create(
path=pooch.os_cache("hothouse"),
base_url="https://github.com/MatthewTurk/hothouse/raw/{version}/data... | 23.888889 | 91 | 0.730233 | import pooch
from . import __version__
_registry = {
"fullSoy_2-12a.ply": "e12f192188058851289f0531dc456c6df31b562405b77e382e0f9e4b1c899108"
}
PLANTS = pooch.create(
path=pooch.os_cache("hothouse"),
base_url="https://github.com/MatthewTurk/hothouse/raw/{version}/data/",
version=__version__,
vers... | true | true |
1c1f9b41309d92d824ce8d8211823a68aef8e23c | 16,995 | py | Python | adafruit_emc2101.py | FoamyGuy/Adafruit_CircuitPython_EMC2101 | c495e121f63898d0e2af7c04ca2e5ebefa8143af | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | adafruit_emc2101.py | FoamyGuy/Adafruit_CircuitPython_EMC2101 | c495e121f63898d0e2af7c04ca2e5ebefa8143af | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | adafruit_emc2101.py | FoamyGuy/Adafruit_CircuitPython_EMC2101 | c495e121f63898d0e2af7c04ca2e5ebefa8143af | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: Copyright (c) 2020 Bryan Siepert for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_emc2101`
================================================================================
Brushless fan controller
* Author(s): Bryan Siepert
Implementation Notes
--------------------
*... | 33.128655 | 100 | 0.648956 |
from micropython import const
from adafruit_register.i2c_struct import ROUnaryStruct, UnaryStruct
from adafruit_register.i2c_bit import RWBit
from adafruit_register.i2c_bits import RWBits
import adafruit_bus_device.i2c_device as i2cdevice
__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafrui... | true | true |
1c1f9c3cc7bcbb8c78c2f73efbfe5c59b7428d1a | 99 | py | Python | pumpkin/items.py | xofbd/pumpkin-scraper | 4b39fd4eaa3a26a5c828254cad9757bcfd15f1da | [
"MIT"
] | null | null | null | pumpkin/items.py | xofbd/pumpkin-scraper | 4b39fd4eaa3a26a5c828254cad9757bcfd15f1da | [
"MIT"
] | null | null | null | pumpkin/items.py | xofbd/pumpkin-scraper | 4b39fd4eaa3a26a5c828254cad9757bcfd15f1da | [
"MIT"
] | null | null | null | from scrapy import Field, Item
class SongItem(Item):
files = Field()
file_urls = Field()
| 14.142857 | 30 | 0.666667 | from scrapy import Field, Item
class SongItem(Item):
files = Field()
file_urls = Field()
| true | true |
1c1f9cfd116babdf603a7a17dad8da309907e56d | 1,266 | py | Python | LoadConf.py | WallaceLiu/obdtool | bc299eddda7b9d1f49e40d2c76b7d8598c697f83 | [
"Apache-2.0"
] | 1 | 2018-05-02T15:02:55.000Z | 2018-05-02T15:02:55.000Z | LoadConf.py | WallaceLiu/obdtool | bc299eddda7b9d1f49e40d2c76b7d8598c697f83 | [
"Apache-2.0"
] | null | null | null | LoadConf.py | WallaceLiu/obdtool | bc299eddda7b9d1f49e40d2c76b7d8598c697f83 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import string
import os
import sys
import ConfigParser
class LoadConf(object):
__configFileName = "app.conf"
def __init__(self):
config = ConfigParser.ConfigParser()
config.read(self.__configFileName)
self.biz_db_host = config.get("biz_db","ho... | 36.171429 | 74 | 0.637441 |
import string
import os
import sys
import ConfigParser
class LoadConf(object):
__configFileName = "app.conf"
def __init__(self):
config = ConfigParser.ConfigParser()
config.read(self.__configFileName)
self.biz_db_host = config.get("biz_db","host")
self.biz_... | false | true |
1c1f9d27a54959e553a7b055cf6e9ac8d5024042 | 1,357 | py | Python | platform/core/polyaxon/compiler/managers/base.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | platform/core/polyaxon/compiler/managers/base.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | platform/core/polyaxon/compiler/managers/base.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | from rest_framework.exceptions import ValidationError
from schemas import PolyaxonSchemaError, ops_params
class BaseCompileManager(object):
KIND = None
SPECIFICATION = None
@staticmethod
def create_context_for_ref(param: ops_params.ParamSpec):
from db.models.experiments import Experiment
... | 33.097561 | 82 | 0.678703 | from rest_framework.exceptions import ValidationError
from schemas import PolyaxonSchemaError, ops_params
class BaseCompileManager(object):
KIND = None
SPECIFICATION = None
@staticmethod
def create_context_for_ref(param: ops_params.ParamSpec):
from db.models.experiments import Experiment
... | true | true |
1c1f9d44188e0df0e0978259ae49c4350245ce9b | 10,798 | py | Python | src/test/test_pandas_eval.py | odinlabs-io/odinlabsio-analytics-app-server | 8073edd13a5ac81ba6c3f189859073b2dfd9b6db | [
"MIT"
] | null | null | null | src/test/test_pandas_eval.py | odinlabs-io/odinlabsio-analytics-app-server | 8073edd13a5ac81ba6c3f189859073b2dfd9b6db | [
"MIT"
] | null | null | null | src/test/test_pandas_eval.py | odinlabs-io/odinlabsio-analytics-app-server | 8073edd13a5ac81ba6c3f189859073b2dfd9b6db | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2020 OdinLabs IO
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, m... | 41.69112 | 115 | 0.591961 |
import unittest
from datetime import datetime
import numpy as np
import pandas as pd
from app.aggregation import pandas_eval_factory
from app.aggregation.aggregation_expr import aggregation_dag, filter_dag
from app.aggregation.pandassolver import DateSolver
eval_factory = pandas_eval_factory()
... | true | true |
1c1f9d9dca245ae5717760acfaef35cf0af411df | 3,007 | py | Python | tests/api/acquisition/test_acq_providers_permissions.py | NRodriguezcuellar/invenio-app-ils | 144a25a6c56330b214c6fd0b832220fa71f2e68a | [
"MIT"
] | 41 | 2018-09-04T13:00:46.000Z | 2022-03-24T20:45:56.000Z | tests/api/acquisition/test_acq_providers_permissions.py | NRodriguezcuellar/invenio-app-ils | 144a25a6c56330b214c6fd0b832220fa71f2e68a | [
"MIT"
] | 720 | 2017-03-10T08:02:41.000Z | 2022-01-14T15:36:37.000Z | tests/api/acquisition/test_acq_providers_permissions.py | NRodriguezcuellar/invenio-app-ils | 144a25a6c56330b214c6fd0b832220fa71f2e68a | [
"MIT"
] | 54 | 2017-03-09T16:05:29.000Z | 2022-03-17T08:34:51.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Test acquisition provider."""
import json
from flask import url_for
from tests.helpers import user_login
_H... | 35.797619 | 77 | 0.674426 |
import json
from flask import url_for
from tests.helpers import user_login
_HTTP_OK = [200, 201, 204]
PROVIDER_PID = "acq-provid-1"
PROVIDER_NAME = "A provider"
PROVIDER_TYPE = "VENDOR"
ITEM_ENDPOINT = "invenio_records_rest.provid_item"
LIST_ENDPOINT = "invenio_records_rest.provid_list"
def test_acq_provid... | true | true |
1c1f9dbab0f2957769d3244e5fee0d655f5af0e6 | 2,598 | py | Python | lte/gateway/python/integ_tests/s1aptests/test_enb_complete_reset.py | remo5000/magma | 1d1dd9a23800a8e07b1ce016776d93e12430ec15 | [
"BSD-3-Clause"
] | 2 | 2020-11-05T18:58:26.000Z | 2021-02-09T06:42:49.000Z | lte/gateway/python/integ_tests/s1aptests/test_enb_complete_reset.py | remo5000/magma | 1d1dd9a23800a8e07b1ce016776d93e12430ec15 | [
"BSD-3-Clause"
] | 14 | 2019-11-15T12:01:18.000Z | 2019-12-12T14:37:42.000Z | lte/gateway/python/integ_tests/s1aptests/test_enb_complete_reset.py | 119Vik/magma-1 | 107a7b374466a837fc0a49b283ba9d6ff1d702e3 | [
"BSD-3-Clause"
] | 3 | 2019-11-15T15:56:25.000Z | 2019-11-21T10:34:59.000Z | """
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
import unittest
import time... | 34.64 | 77 | 0.637413 |
import unittest
import time
import s1ap_types
import s1ap_wrapper
class TestEnbCompleteReset(unittest.TestCase):
def setUp(self):
self._s1ap_wrapper = s1ap_wrapper.TestWrapper()
def tearDown(self):
self._s1ap_wrapper.cleanup()
def test_enb_complete_reset(self):
ue_ids = []
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.