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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7091b6372c395203c4bc05e0c18ff979fa41275 | 456 | py | Python | remove_errors.py | martinetmayank/telegram-chats | ad79f3357d657415f57c83f219fc3ad7d57081eb | [
"Apache-2.0"
] | null | null | null | remove_errors.py | martinetmayank/telegram-chats | ad79f3357d657415f57c83f219fc3ad7d57081eb | [
"Apache-2.0"
] | 1 | 2021-04-30T21:26:01.000Z | 2021-04-30T21:26:01.000Z | remove_errors.py | martinetmayank/telegram-chats | ad79f3357d657415f57c83f219fc3ad7d57081eb | [
"Apache-2.0"
] | null | null | null | def correct_ini_file(config_file):
with open(config_file, mode='r') as raw_open:
raw_open.seek(0)
temp_api_details = raw_open.readlines(0)
# print(type(temp_api_details[0]))
with open(config_file, mode='w') as rewrite_config:
if temp_api_details[0] != '[TELEGRAM]\n':
... | 32.571429 | 56 | 0.60307 | def correct_ini_file(config_file):
with open(config_file, mode='r') as raw_open:
raw_open.seek(0)
temp_api_details = raw_open.readlines(0)
with open(config_file, mode='w') as rewrite_config:
if temp_api_details[0] != '[TELEGRAM]\n':
rewrite_config.write('[TELE... | true | true |
f7091b68ebbfbd69780202759a09375d54581042 | 2,147 | py | Python | tests/test_encoding.py | samv/unique | d5d8deb109d0b14ce072118432baf0bebc11826b | [
"MIT"
] | 1 | 2015-04-02T20:27:25.000Z | 2015-04-02T20:27:25.000Z | tests/test_encoding.py | samv/unique | d5d8deb109d0b14ce072118432baf0bebc11826b | [
"MIT"
] | null | null | null | tests/test_encoding.py | samv/unique | d5d8deb109d0b14ce072118432baf0bebc11826b | [
"MIT"
] | null | null | null |
import json
import unittest2
from normalize import from_json
from normalize import JsonProperty
from normalize import JsonRecord
from normalize import Property
from normalize import Record
from normalize import to_json
from unique.encoding import JSONRecordIO
from testclasses import MultiLevelKeyValue
from testclas... | 28.25 | 81 | 0.63251 |
import json
import unittest2
from normalize import from_json
from normalize import JsonProperty
from normalize import JsonRecord
from normalize import Property
from normalize import Record
from normalize import to_json
from unique.encoding import JSONRecordIO
from testclasses import MultiLevelKeyValue
from testclas... | true | true |
f7091ba4774ace99be57da4a09c120ccf6dd67e9 | 22,801 | py | Python | examples/sc2autosave.py | HADB/sc2reader | 6bb984dbe85f46a6684680dd0e56c09d7188214b | [
"MIT"
] | 117 | 2016-09-11T16:42:05.000Z | 2022-03-27T22:07:34.000Z | examples/sc2autosave.py | Kaszanas/sc2reader | 86bd9b70c3aef8319ce7c8c06cac8a4bdfe3fd23 | [
"MIT"
] | 120 | 2016-01-10T17:41:45.000Z | 2022-03-28T04:46:16.000Z | examples/sc2autosave.py | Kaszanas/sc2reader | 86bd9b70c3aef8319ce7c8c06cac8a4bdfe3fd23 | [
"MIT"
] | 58 | 2016-02-03T18:06:26.000Z | 2021-09-07T03:08:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""sc2autosave is a utility for reorganizing and renaming Starcraft II files.
Overview
==============
sc2autosave provides a simple mechanism for renaming replay files as they are
copied or moved from a source directory to a destination directory. In between
runs the stat... | 37.378689 | 101 | 0.630718 | import argparse
import cPickle
import os
import shutil
import sys
import time
import sc2reader
try:
raw_input except NameError:
raw_input = input
def run(args):
if args.reset:
reset(args)
state = setup(args)
while True:
for path in scan(args, ... | true | true |
f7091cc867b32d1268be2ef4dea0d3b3be89c573 | 20,500 | py | Python | nevergrad/optimization/recastlib.py | mathuvu/nevergrad | 8e116190a8a29c238e655d728fc4816f7b4e0415 | [
"MIT"
] | null | null | null | nevergrad/optimization/recastlib.py | mathuvu/nevergrad | 8e116190a8a29c238e655d728fc4816f7b4e0415 | [
"MIT"
] | null | null | null | nevergrad/optimization/recastlib.py | mathuvu/nevergrad | 8e116190a8a29c238e655d728fc4816f7b4e0415 | [
"MIT"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import functools
import math
import warnings
import weakref
import numpy as np
from scipy import optimize as scipyoptimize
import nevergrad... | 40.354331 | 117 | 0.615073 |
import functools
import math
import warnings
import weakref
import numpy as np
from scipy import optimize as scipyoptimize
import nevergrad.common.typing as tp
from nevergrad.parametrization import parameter as p
from nevergrad.common import errors
from . import base
from .base import IntOrParameter
from . import rec... | true | true |
f7091dc148b356a0b6931bd347d661f76f85ade9 | 627 | py | Python | Day16/program.py | CAG2Mark/Advent-Of-Code-Solutions | b744025b8c53dc7ea810a13dc818568520110b86 | [
"MIT"
] | null | null | null | Day16/program.py | CAG2Mark/Advent-Of-Code-Solutions | b744025b8c53dc7ea810a13dc818568520110b86 | [
"MIT"
] | null | null | null | Day16/program.py | CAG2Mark/Advent-Of-Code-Solutions | b744025b8c53dc7ea810a13dc818568520110b86 | [
"MIT"
] | null | null | null | # valid ranges
rules = []
while True:
try:
ln = input()
if not ln.strip():
break
rule = [x.split("-") for x in ln.split(": ")[1].split(" or ")]
for r in rule:
rules.append([int(x) for x in r])
except EOFError:
break
while True:
... | 19 | 70 | 0.464115 | rules = []
while True:
try:
ln = input()
if not ln.strip():
break
rule = [x.split("-") for x in ln.split(": ")[1].split(" or ")]
for r in rule:
rules.append([int(x) for x in r])
except EOFError:
break
while True:
if not input().... | true | true |
f7091e05767123ebd494b47f0357c05cee301864 | 2,616 | py | Python | reports/report/visualizations/linplot.py | pplonski/automlbenchmark | f49ddfa2583643173296ed8ab45a8c14c62a6987 | [
"MIT"
] | 4 | 2021-04-26T12:03:59.000Z | 2021-11-07T20:06:00.000Z | reports/report/visualizations/linplot.py | pplonski/automlbenchmark | f49ddfa2583643173296ed8ab45a8c14c62a6987 | [
"MIT"
] | null | null | null | reports/report/visualizations/linplot.py | pplonski/automlbenchmark | f49ddfa2583643173296ed8ab45a8c14c62a6987 | [
"MIT"
] | null | null | null | import matplotlib as mp
import pandas as pd
import seaborn as sb
import report.config as config
from ..util import create_file, sort_dataframe
from .util import savefig, set_scales, set_labels, task_labels
def draw_parallel_coord(df, class_column,
x_labels=True, yscale='linear',
... | 48.444444 | 110 | 0.569572 | import matplotlib as mp
import pandas as pd
import seaborn as sb
import report.config as config
from ..util import create_file, sort_dataframe
from .util import savefig, set_scales, set_labels, task_labels
def draw_parallel_coord(df, class_column,
x_labels=True, yscale='linear',
... | true | true |
f7091f618378824f233afd61b0beecfbadd5f8c8 | 2,552 | py | Python | lib/greet.py | yndajas/Twitch-YndaBot | 41b3600f5336a073f42c1cc296609dbe88c8e510 | [
"MIT"
] | null | null | null | lib/greet.py | yndajas/Twitch-YndaBot | 41b3600f5336a073f42c1cc296609dbe88c8e510 | [
"MIT"
] | null | null | null | lib/greet.py | yndajas/Twitch-YndaBot | 41b3600f5336a073f42c1cc296609dbe88c8e510 | [
"MIT"
] | null | null | null | async def greet(ctx):
greetings = [
"Ahn nyong ha se yo",
"Ahn-nyong-ha-se-yo",
"Ahoj",
"An-nyŏng-ha-se-yo",
"As-salamu alaykum",
"Assalamo aleikum",
"Assalamualaikum",
"Avuxeni",
"Bonġu",
"Bonjour",
"Bună ziua",
"Ciao",... | 25.019608 | 83 | 0.460031 | async def greet(ctx):
greetings = [
"Ahn nyong ha se yo",
"Ahn-nyong-ha-se-yo",
"Ahoj",
"An-nyŏng-ha-se-yo",
"As-salamu alaykum",
"Assalamo aleikum",
"Assalamualaikum",
"Avuxeni",
"Bonġu",
"Bonjour",
"Bună ziua",
"Ciao",... | true | true |
f7091f945438d05214721e9df9b4991008b776a6 | 968 | py | Python | services/core-api/app/api/now_applications/models/activity_summary/cut_lines_polarization_survey.py | bcgov/mds | 6c427a66a5edb4196222607291adef8fd6677038 | [
"Apache-2.0"
] | 25 | 2018-07-09T19:04:37.000Z | 2022-03-15T17:27:10.000Z | services/core-api/app/api/now_applications/models/activity_summary/cut_lines_polarization_survey.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | 983 | 2018-04-25T20:08:07.000Z | 2022-03-31T21:45:20.000Z | services/core-api/app/api/now_applications/models/activity_summary/cut_lines_polarization_survey.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | 58 | 2018-05-15T22:35:50.000Z | 2021-11-29T19:40:52.000Z | from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.schema import FetchedValue
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.hybrid import hybrid_property
from app.api.utils.models_mixins import Base
from app.extensions import db
from app.api.now_applications.models.act... | 33.37931 | 102 | 0.785124 | from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.schema import FetchedValue
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.hybrid import hybrid_property
from app.api.utils.models_mixins import Base
from app.extensions import db
from app.api.now_applications.models.act... | true | true |
f709200bc42e18277171017bd58e82fdd5518401 | 144 | py | Python | contacts/apps.py | phildini/logtacts | 2cfc1d93a6ec7535b57a42b46b7d8c5c09a4729b | [
"MIT"
] | 56 | 2016-02-22T16:12:53.000Z | 2021-01-12T20:59:02.000Z | contacts/apps.py | phildini/logtacts | 2cfc1d93a6ec7535b57a42b46b7d8c5c09a4729b | [
"MIT"
] | 107 | 2016-01-04T00:49:37.000Z | 2021-11-18T18:27:24.000Z | contacts/apps.py | phildini/logtacts | 2cfc1d93a6ec7535b57a42b46b7d8c5c09a4729b | [
"MIT"
] | 23 | 2016-01-04T00:54:09.000Z | 2021-07-09T15:23:15.000Z | from django.apps import AppConfig
class ContactConfig(AppConfig):
name = 'contacts'
def ready(self):
import contacts.signals
| 16 | 33 | 0.701389 | from django.apps import AppConfig
class ContactConfig(AppConfig):
name = 'contacts'
def ready(self):
import contacts.signals
| true | true |
f7092088390ccc9209ff2691ca6f9d0dba0c03d2 | 2,644 | py | Python | scrapers/add_db_entry.py | ivanek/covid_19 | e7d7652c65cbdf9a2b12ddacaa7f2415d11a5b87 | [
"CC-BY-4.0"
] | 1 | 2020-03-30T12:48:04.000Z | 2020-03-30T12:48:04.000Z | scrapers/add_db_entry.py | prematzerosoft/covid_19 | a642d7ce12830d4bace93dd14b850973cfeee6b0 | [
"CC-BY-4.0"
] | null | null | null | scrapers/add_db_entry.py | prematzerosoft/covid_19 | a642d7ce12830d4bace93dd14b850973cfeee6b0 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python3
import re
import sys
import sqlite3
import traceback
import os
__location__ = os.path.realpath(
os.path.join(
os.getcwd(),
os.path.dirname(__file__)
)
)
input_failures = 0
try:
DATABASE_NAME = os.path.join(__location__, 'data.sqlite')
conn = sqlite3.connect(DAT... | 25.921569 | 77 | 0.421331 |
import re
import sys
import sqlite3
import traceback
import os
__location__ = os.path.realpath(
os.path.join(
os.getcwd(),
os.path.dirname(__file__)
)
)
input_failures = 0
try:
DATABASE_NAME = os.path.join(__location__, 'data.sqlite')
conn = sqlite3.connect(DATABASE_NAME)
i = 0
... | true | true |
f70920a45d8b352e57cdd5c4ba4ed7a956b3f421 | 4,150 | py | Python | pyesgf/util.py | ggarcias/esgf-pyclient-cmip6 | 9e7975d2e676ed2c4001edb4e25c9c20cc16b7af | [
"BSD-3-Clause"
] | 17 | 2016-09-07T02:55:30.000Z | 2022-03-10T15:34:53.000Z | pyesgf/util.py | ggarcias/esgf-pyclient-cmip6 | 9e7975d2e676ed2c4001edb4e25c9c20cc16b7af | [
"BSD-3-Clause"
] | 61 | 2015-05-27T08:10:46.000Z | 2022-03-17T12:36:45.000Z | pyesgf/util.py | ggarcias/esgf-pyclient-cmip6 | 9e7975d2e676ed2c4001edb4e25c9c20cc16b7af | [
"BSD-3-Clause"
] | 22 | 2015-10-27T11:21:05.000Z | 2022-01-12T08:26:16.000Z | """
Utility functions using the pyesgf package.
"""
import sys
from urllib.parse import quote_plus
def ats_url(base_url):
"""
Return the URL for the ESGF SAML AttributeService
"""
# Strip '/' from url as necessary
base_url = base_url.rstrip('/')
return '/'.join([base_url,
... | 30.291971 | 78 | 0.576867 |
import sys
from urllib.parse import quote_plus
def ats_url(base_url):
base_url = base_url.rstrip('/')
return '/'.join([base_url,
'esgf-idp/saml/soap/secure/attributeService.htm'])
def get_manifest(drs_id, version, connection):
if isinstance(version, int):
version = str(... | true | true |
f70920aa2ec17f63790605e4dc9745d131bf1ad5 | 27,868 | py | Python | apps/addons/forms.py | Joergen/olympia | eb84203469adbb6584e50d7bb6f9de7f20980dac | [
"BSD-3-Clause"
] | null | null | null | apps/addons/forms.py | Joergen/olympia | eb84203469adbb6584e50d7bb6f9de7f20980dac | [
"BSD-3-Clause"
] | null | null | null | apps/addons/forms.py | Joergen/olympia | eb84203469adbb6584e50d7bb6f9de7f20980dac | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
from decimal import Decimal
import os
from django import forms
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.forms.formsets import formset_factory
import commonware.log
import happyforms
from quieter_formset.formset import B... | 38.123119 | 79 | 0.611885 | from datetime import datetime
from decimal import Decimal
import os
from django import forms
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.forms.formsets import formset_factory
import commonware.log
import happyforms
from quieter_formset.formset import B... | true | true |
f70921c6af89f557c4ad7ff0343c8dc6ea00a385 | 1,445 | py | Python | pdata/dirstructure.py | semeniuta/pdata | 5eb6ece8e2fb1856bc87ed76290240cd901f7654 | [
"BSD-3-Clause"
] | null | null | null | pdata/dirstructure.py | semeniuta/pdata | 5eb6ece8e2fb1856bc87ed76290240cd901f7654 | [
"BSD-3-Clause"
] | null | null | null | pdata/dirstructure.py | semeniuta/pdata | 5eb6ece8e2fb1856bc87ed76290240cd901f7654 | [
"BSD-3-Clause"
] | null | null | null | import os
from glob import glob
import pandas as pd
def get_list_of_full_child_dirs(d):
"""
For a directory d (full path),
return a list of its subdirectories
in a full path form.
"""
children = (os.path.join(d, child) for child in os.listdir(d))
dirs = filter(os.path.isdir, children)
... | 24.491525 | 78 | 0.657439 | import os
from glob import glob
import pandas as pd
def get_list_of_full_child_dirs(d):
children = (os.path.join(d, child) for child in os.listdir(d))
dirs = filter(os.path.isdir, children)
return list(dirs)
def split_full_path(full_path, base_dir):
fname = os.path.basename(full_path)
relati... | true | true |
f709225799582acc8b4fb03957fc54ab2aaada80 | 631 | py | Python | problems/31/problem_31.py | r1cc4rdo/daily_coding_problem | 6ac85309fad2f64231ac7ab94aa4158e18bdec40 | [
"Unlicense"
] | 158 | 2018-01-25T06:33:30.000Z | 2022-03-14T23:18:05.000Z | problems/31/problem_31.py | r1cc4rdo/daily_coding_problem | 6ac85309fad2f64231ac7ab94aa4158e18bdec40 | [
"Unlicense"
] | 9 | 2018-07-04T00:31:57.000Z | 2020-05-16T21:02:30.000Z | problems/31/problem_31.py | r1cc4rdo/daily_coding_problem | 6ac85309fad2f64231ac7ab94aa4158e18bdec40 | [
"Unlicense"
] | 50 | 2018-06-22T16:48:44.000Z | 2022-01-11T16:45:48.000Z | def coding_problem_31(s, t, debt=0):
"""
Given two strings, compute the edit distance between them.
The edit distance between two strings refers to the minimum number of character insertions, deletions, and
substitutions required to change one string to the other.
Example:
>>> coding_problem_31... | 26.291667 | 110 | 0.635499 | def coding_problem_31(s, t, debt=0):
pass
if __name__ == '__main__':
import doctest
doctest.testmod(verbose=True)
| true | true |
f709226fc4762f35761640ef37183013e4082969 | 1,221 | py | Python | pytorch_ess/mean_elliptical_slice.py | wjmaddox/pytorch_ess | 8e189666ce7381cf760666464384c634abbc4be2 | [
"Apache-2.0"
] | 1 | 2022-02-19T12:37:06.000Z | 2022-02-19T12:37:06.000Z | pytorch_ess/mean_elliptical_slice.py | wjmaddox/pytorch_ess | 8e189666ce7381cf760666464384c634abbc4be2 | [
"Apache-2.0"
] | null | null | null | pytorch_ess/mean_elliptical_slice.py | wjmaddox/pytorch_ess | 8e189666ce7381cf760666464384c634abbc4be2 | [
"Apache-2.0"
] | null | null | null | import torch
from .elliptical_slice import EllipticalSliceSampler
class MeanEllipticalSliceSampler(EllipticalSliceSampler):
def __init__(self, f_init, dist, lnpdf, nsamples, pdf_params=()):
"""
Implementation of elliptical slice sampling (Murray, Adams, & Mckay, 2010).
f_init: initial val... | 34.885714 | 130 | 0.684685 | import torch
from .elliptical_slice import EllipticalSliceSampler
class MeanEllipticalSliceSampler(EllipticalSliceSampler):
def __init__(self, f_init, dist, lnpdf, nsamples, pdf_params=()):
mean_vector = dist.mean
demeaned_lnpdf = lambda g: lnpdf(g + mean_vector, *pdf_params)
demeaned_i... | true | true |
f70922c43840ce448deb9296e93b5401d187395f | 7,592 | py | Python | src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_operations.py | Sneezry/azure-cli-extensions | bd186fe31c8fbd8c8b945fb749349e7f243be532 | [
"MIT"
] | null | null | null | src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_operations.py | Sneezry/azure-cli-extensions | bd186fe31c8fbd8c8b945fb749349e7f243be532 | [
"MIT"
] | null | null | null | src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_operations.py | Sneezry/azure-cli-extensions | bd186fe31c8fbd8c8b945fb749349e7f243be532 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.620915 | 214 | 0.683351 | from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import Asyn... | true | true |
f709233cf0c713f895035d7036aa596c63d20754 | 1,139 | py | Python | dog_recognition/models/vgg.py | helloholmes/dog_detection_gluoncv | eff91aa43633adcc1339a8d1f31ed667fdae846f | [
"Apache-2.0"
] | 2 | 2018-08-11T13:55:41.000Z | 2020-04-26T08:06:29.000Z | models/vgg.py | helloholmes/dog_detection_gluoncv | eff91aa43633adcc1339a8d1f31ed667fdae846f | [
"Apache-2.0"
] | null | null | null | models/vgg.py | helloholmes/dog_detection_gluoncv | eff91aa43633adcc1339a8d1f31ed667fdae846f | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
'''
python 3.5
mxnet 1.3.0
gluoncv 0.3.0
visdom 0.1.7
gluonbook 0.6.9
auther: helloholmes
'''
import mxnet as mx
import numpy as np
import os
import time
import pickle
from mxnet import gluon
from mxnet import init
from mxnet import nd
from mxnet import autograd
from mxnet.gluon import nn
class VGG16(nn... | 24.234043 | 74 | 0.626866 | import mxnet as mx
import numpy as np
import os
import time
import pickle
from mxnet import gluon
from mxnet import init
from mxnet import nd
from mxnet import autograd
from mxnet.gluon import nn
class VGG16(nn.HybridBlock):
def __init__(self, num_classes=120, **kwargs):
super(VGG16, self).__init__(**k... | true | true |
f709237a5a4a3e19ba965c764a9817e628ec93be | 1,797 | py | Python | python/lax_sod_data.py | kjetil-lye/lax_sod_shock_tube_machine_learning | a0e8600eba89737a03bdea3d82756a2a0ccf0259 | [
"MIT"
] | null | null | null | python/lax_sod_data.py | kjetil-lye/lax_sod_shock_tube_machine_learning | a0e8600eba89737a03bdea3d82756a2a0ccf0259 | [
"MIT"
] | null | null | null | python/lax_sod_data.py | kjetil-lye/lax_sod_shock_tube_machine_learning | a0e8600eba89737a03bdea3d82756a2a0ccf0259 | [
"MIT"
] | null | null | null | import os
import numpy as np
def get_lax_sod_network():
return [12, 12, 10, 12, 10, 12, 10, 10, 12,1]
def get_lax_sod_data_inner():
data_path = os.environ.get("LAX_SOD_REPO_PATH", "../lax_sod_tube")
qmc_points = np.loadtxt(os.path.join(data_path, "parameters/parameters_sobol_X.txt"))
forces = np... | 23.337662 | 98 | 0.674457 | import os
import numpy as np
def get_lax_sod_network():
return [12, 12, 10, 12, 10, 12, 10, 10, 12,1]
def get_lax_sod_data_inner():
data_path = os.environ.get("LAX_SOD_REPO_PATH", "../lax_sod_tube")
qmc_points = np.loadtxt(os.path.join(data_path, "parameters/parameters_sobol_X.txt"))
forces = np... | true | true |
f70923a1041886df98850f9ba4df0b8e849b83fe | 1,795 | py | Python | src/compiler/setuppaths.py | fnoeding/exoself | 11dfceea12a9f6f8ed0018fd60e6de5f73b9fa35 | [
"BSD-3-Clause"
] | 4 | 2015-12-18T10:36:38.000Z | 2021-03-19T04:54:03.000Z | src/compiler/setuppaths.py | fnoeding/exoself | 11dfceea12a9f6f8ed0018fd60e6de5f73b9fa35 | [
"BSD-3-Clause"
] | null | null | null | src/compiler/setuppaths.py | fnoeding/exoself | 11dfceea12a9f6f8ed0018fd60e6de5f73b9fa35 | [
"BSD-3-Clause"
] | null | null | null | #
# The BSD License
#
# Copyright (c) 2008, Florian Noeding
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# li... | 46.025641 | 94 | 0.773816 |
import sys
import os
sys.path.append(os.path.normpath(os.path.join(sys.path[0], '..', '..', '3rdparty', 'pylibs')))
sys.path.append(os.path.normpath(os.path.join(sys.path[0], 'grammar')))
| true | true |
f70923eab3da1bedc87560d855a3d722ac2685a4 | 9,918 | py | Python | kiauto/misc.py | jaessy77/KiAuto | 517af0808f38bcf57b8ab584e130d2aad3834376 | [
"Apache-2.0"
] | null | null | null | kiauto/misc.py | jaessy77/KiAuto | 517af0808f38bcf57b8ab584e130d2aad3834376 | [
"Apache-2.0"
] | null | null | null | kiauto/misc.py | jaessy77/KiAuto | 517af0808f38bcf57b8ab584e130d2aad3834376 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020-2021 Salvador E. Tropea
# Copyright (c) 2020-2021 Instituto Nacional de Tecnologïa Industrial
# License: Apache 2.0
# Project: KiAuto (formerly kicad-automation-scripts)
import os
import re
import json
import configparser
from contextlib import contextmanager
from sys import... | 40.153846 | 121 | 0.619076 | import os
import re
import json
import configparser
from contextlib import contextmanager
from sys import exit, path
REC_W = 1366
REC_H = 960
NO_SCHEMATIC = 1
WRONG_ARGUMENTS = 2 EESCHEMA_CFG_PRESENT = 11
KICAD_CFG_PRESENT = 3
NO_PCB = 4
PCBNEW_CFG_PRESENT = 5
WRONG_LAYER_NAME = 6
WRONG_PCB_NAME = 7
WRONG_SCH_NAME ... | true | true |
f70924607cd6bc830019782182dd67bf0f16ab46 | 246 | py | Python | discord_bot/config.sample.py | treasure-hacks/treasure-hacks-ctf | 9d07d0182bb096ed7161ba9d35299d60ade9cf5a | [
"MIT"
] | null | null | null | discord_bot/config.sample.py | treasure-hacks/treasure-hacks-ctf | 9d07d0182bb096ed7161ba9d35299d60ade9cf5a | [
"MIT"
] | null | null | null | discord_bot/config.sample.py | treasure-hacks/treasure-hacks-ctf | 9d07d0182bb096ed7161ba9d35299d60ade9cf5a | [
"MIT"
] | null | null | null | # Replace with DB URI; proto://user:pass@host/database
DB_URI = "replace"
# Replace with bot token
TOKEN = "replace"
# Replace with IDs of admin command users
ADMIN_IDS = []
# Replace with voice channel for audio clue
TARGET_VOICE_CHANNEL = 0
| 20.5 | 54 | 0.743902 | DB_URI = "replace"
TOKEN = "replace"
ADMIN_IDS = []
TARGET_VOICE_CHANNEL = 0
| true | true |
f70924d202c078270870d9d0bb24cb8b377f14c1 | 2,413 | py | Python | nicos_jcns/galaxi/devices/automation.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_jcns/galaxi/devices/automation.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-08-18T10:55:42.000Z | 2021-08-18T10:55:42.000Z | nicos_jcns/galaxi/devices/automation.py | ISISComputingGroup/nicos | 94cb4d172815919481f8c6ee686f21ebb76f2068 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 36.014925 | 79 | 0.63075 |
from nicos.core.device import Readable
from nicos.core.params import Attach, Param, listof
from nicos.devices.tango import NamedDigitalOutput
class DetectorDistance(Readable):
attached_devices = {
'detectubes': Attach('Pilatus detector tubes', Readable, multiple=4)
}
parameters = {
'of... | true | true |
f709254330ef76af7db62a35d05bbcb48fbff96b | 6,705 | py | Python | py4syn/epics/LaudaClass.py | lnls-sol/py4syn-old | 6653faa788b273c8a592ae7548f9027fd95cc62a | [
"0BSD"
] | 12 | 2015-07-12T17:15:06.000Z | 2018-04-28T06:51:15.000Z | py4syn/epics/LaudaClass.py | lnls-sol/py4syn-old | 6653faa788b273c8a592ae7548f9027fd95cc62a | [
"0BSD"
] | 29 | 2016-06-28T12:24:08.000Z | 2018-10-22T15:59:43.000Z | py4syn/epics/LaudaClass.py | lnls-sol/py4syn-old | 6653faa788b273c8a592ae7548f9027fd95cc62a | [
"0BSD"
] | 10 | 2015-09-02T17:30:33.000Z | 2018-01-18T18:52:32.000Z | """Lauda temperature controller class
Python class for Lauda temperature controllers
:platform: Unix
:synopsis: Python class for Lauda temperature controllers
.. moduleauthor:: Henrique Dante de Almeida <henrique.almeida@lnls.br>
"""
from threading import Event
from epics import Device, ca
from py4syn.epics.IScan... | 21.983607 | 90 | 0.509918 | from threading import Event
from epics import Device, ca
from py4syn.epics.IScannable import IScannable
from py4syn.epics.StandardDevice import StandardDevice
from py4syn.utils.timer import Timer
class Lauda(StandardDevice, IScannable):
EPSILON = 0.1
def __init__(self, pvName, mnemonic):
super().__... | true | true |
f70925733799e0b5c6d890ecbb866e5f5a32c735 | 1,110 | py | Python | demos/sparse_op/wfuncs/H0/donut.py | tbcole/majoranaJJ | dcf31f7786fa0a4874a940b7d8dcdd55f3921a46 | [
"MIT"
] | null | null | null | demos/sparse_op/wfuncs/H0/donut.py | tbcole/majoranaJJ | dcf31f7786fa0a4874a940b7d8dcdd55f3921a46 | [
"MIT"
] | 2 | 2020-03-24T23:46:17.000Z | 2020-04-19T20:29:08.000Z | demos/sparse_op/wfuncs/H0/donut.py | tbcole/majoranaJJ | dcf31f7786fa0a4874a940b7d8dcdd55f3921a46 | [
"MIT"
] | 3 | 2020-04-30T08:48:12.000Z | 2022-01-26T12:15:15.000Z | import numpy as np
import matplotlib.pyplot as plt
import scipy.sparse.linalg as spLA
import majoranaJJ.operators.sparse.qmsops as spop #sparse operators
import majoranaJJ.lattice.nbrs as nb #neighbor arrays
import majoranaJJ.lattice.shapes as shps #lattice shapes
import majoranaJJ.modules.plots as plots #plotting fun... | 30.833333 | 89 | 0.713514 | import numpy as np
import matplotlib.pyplot as plt
import scipy.sparse.linalg as spLA
import majoranaJJ.operators.sparse.qmsops as spop import majoranaJJ.lattice.nbrs as nb import majoranaJJ.lattice.shapes as shps import majoranaJJ.modules.plots as plots
R = 50
r = 15
ax = 10 ay = 10
coor = shps.donut(R, r)
NN = nb.... | true | true |
f70925fd466531f7885b22db0a2494715d6a730b | 1,181 | py | Python | backend/app/api/auth.py | dasdachs/flask-blog | d484026c1057e991a89df54d3fec20b43a507d1b | [
"MIT"
] | null | null | null | backend/app/api/auth.py | dasdachs/flask-blog | d484026c1057e991a89df54d3fec20b43a507d1b | [
"MIT"
] | null | null | null | backend/app/api/auth.py | dasdachs/flask-blog | d484026c1057e991a89df54d3fec20b43a507d1b | [
"MIT"
] | 1 | 2020-04-08T17:48:34.000Z | 2020-04-08T17:48:34.000Z | #!/usr/bin/env python3.4
from flask import Blueprint, flash, redirect, render_template, request, url_for
from flask.ext.login import login_user, logout_user, login_required
from ..models import User
from ..forms import LoginForm
auth = Blueprint('auth', __name__)
@auth.route('/login', methods=['GET', 'POST'])
def... | 31.078947 | 79 | 0.690093 | from flask import Blueprint, flash, redirect, render_template, request, url_for
from flask.ext.login import login_user, logout_user, login_required
from ..models import User
from ..forms import LoginForm
auth = Blueprint('auth', __name__)
@auth.route('/login', methods=['GET', 'POST'])
def login():
form = Logi... | true | true |
f7092607e2f50e603d2cab1086ade69261c874d1 | 11,241 | py | Python | outputFiles/statistics/archives/ourIA/closest.py/0.9/9/player1.py | dimtion/jml | dba4db760280cc5ed8c384e36e41d6c7a310fb4f | [
"MIT"
] | 1 | 2015-10-07T19:18:55.000Z | 2015-10-07T19:18:55.000Z | outputFiles/statistics/archives/ourIA/closest.py/0.9/9/player1.py | dimtion/jml | dba4db760280cc5ed8c384e36e41d6c7a310fb4f | [
"MIT"
] | 1 | 2015-10-07T19:28:25.000Z | 2015-10-08T19:01:47.000Z | outputFiles/statistics/archives/ourIA/closest.py/0.9/9/player1.py | dimtion/jml | dba4db760280cc5ed8c384e36e41d6c7a310fb4f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
####################################################################################################################################################################################################################################
############################################... | 64.976879 | 228 | 0.357708 |
import ast
import sys
import os
UP = 'U'
DOWN = 'D'
LEFT = 'L'
RIGHT = 'R'
TEAM_NAME = "closest"
allMoves = [RIGHT, RIGHT, RIGHT, UP, RIGHT, RIGHT, RIGHT, UP, UP, UP, RIGHT, UP, UP, UP, RIGHT, UP]
def debug (text) :
sys.stderr.write(str(text) + "\n")
sys.stderr.flush()
def readFromPipe () ... | true | true |
f7092662056ebef64208f6ab439e77a3dae4b1e8 | 1,412 | py | Python | setup.py | masudurHimel/TestLibrary | 911f2762ed11b8fd79a32c1a9ecc30331d111998 | [
"MIT"
] | null | null | null | setup.py | masudurHimel/TestLibrary | 911f2762ed11b8fd79a32c1a9ecc30331d111998 | [
"MIT"
] | null | null | null | setup.py | masudurHimel/TestLibrary | 911f2762ed11b8fd79a32c1a9ecc30331d111998 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name='TestLibrary_MR', # How you named your package folder (MyLib)
packages=['TestLibrary_MR'], # Chose the same as "name"
version='0.2', # Start with a small number and increase it with every change you make
license='MIT', # Chose a license from here: https:... | 58.833333 | 123 | 0.689802 | from distutils.core import setup
setup(
name='TestLibrary_MR', packages=['TestLibrary_MR'], version='0.2', license='MIT', description='Just a test module', author='Md. Masudur Rahman', author_email='masudurhimel@gmail.com', url='https://github.com/masudurHimel/TestLibrary_MR', ... | true | true |
f70926f0ac93c387914718f3fd574704afb0fbea | 5,832 | py | Python | cogs/encoding.py | vierofernando/username601 | b5309b91b9da49a2a5cee1596084d450b987c17a | [
"MIT"
] | 48 | 2020-05-21T16:29:46.000Z | 2021-12-30T00:09:45.000Z | cogs/encoding.py | vierofernando/username601 | b5309b91b9da49a2a5cee1596084d450b987c17a | [
"MIT"
] | 5 | 2020-08-28T02:06:45.000Z | 2021-11-08T11:02:36.000Z | cogs/encoding.py | vierofernando/username601 | b5309b91b9da49a2a5cee1596084d450b987c17a | [
"MIT"
] | 24 | 2020-06-08T14:47:09.000Z | 2021-09-28T18:46:13.000Z | import discord
from discord.ext import commands
from decorators import *
from io import BytesIO
from urllib.parse import quote
from base64 import b64encode
from json import loads
class encoding(commands.Cog):
def __init__(self):
self.ciphers = loads(open("./assets/json/encode.json", "r").read())
pa... | 35.560976 | 139 | 0.564986 | import discord
from discord.ext import commands
from decorators import *
from io import BytesIO
from urllib.parse import quote
from base64 import b64encode
from json import loads
class encoding(commands.Cog):
def __init__(self):
self.ciphers = loads(open("./assets/json/encode.json", "r").read())
pa... | true | true |
f709278271159bcb09d59ef159f718217946794c | 1,237 | py | Python | py/scrapeJson.py | mpaulweeks/edh-obscurity | 58b6d34775111f5c111424ee51b186943ecd478d | [
"MIT"
] | null | null | null | py/scrapeJson.py | mpaulweeks/edh-obscurity | 58b6d34775111f5c111424ee51b186943ecd478d | [
"MIT"
] | null | null | null | py/scrapeJson.py | mpaulweeks/edh-obscurity | 58b6d34775111f5c111424ee51b186943ecd478d | [
"MIT"
] | null | null | null |
import json
import requests
EDHREC_BASE_URL = 'https://edhrec-json.s3.amazonaws.com/commanders/%s.json'
COMMANDER_PAGE_SLUGS = frozenset([
'w',
'u',
'b',
'r',
'g',
'colorless',
'wu',
'ub',
'br',
'rg',
'gw',
'wb',
'ur',
'bg',
'rw',
'gu',
'wub',
... | 17.180556 | 75 | 0.547292 |
import json
import requests
EDHREC_BASE_URL = 'https://edhrec-json.s3.amazonaws.com/commanders/%s.json'
COMMANDER_PAGE_SLUGS = frozenset([
'w',
'u',
'b',
'r',
'g',
'colorless',
'wu',
'ub',
'br',
'rg',
'gw',
'wb',
'ur',
'bg',
'rw',
'gu',
'wub',
... | true | true |
f70928592e8883c6be6fc9952f6de13f07725f2b | 1,063 | py | Python | Iterative Methods/gauss_jacobi.py | Hariharan-SV/Scientific-Computing | fccb065fe176f5fac6a463ec29f7e618dabd8099 | [
"MIT"
] | null | null | null | Iterative Methods/gauss_jacobi.py | Hariharan-SV/Scientific-Computing | fccb065fe176f5fac6a463ec29f7e618dabd8099 | [
"MIT"
] | null | null | null | Iterative Methods/gauss_jacobi.py | Hariharan-SV/Scientific-Computing | fccb065fe176f5fac6a463ec29f7e618dabd8099 | [
"MIT"
] | null | null | null | import get_coefficients_as_list
import check_diagonal_dominant
# function that computes in gauss jacobi method
def gauss_jacobi(no_of_unknowns):
coefficient_list = get_coefficients_as_list.get_coefficients_as_list(no_of_unknowns)
if check_diagonal_dominant.is_diagonally_dominant(coefficient_list):
print("Compu... | 42.52 | 86 | 0.71778 | import get_coefficients_as_list
import check_diagonal_dominant
def gauss_jacobi(no_of_unknowns):
coefficient_list = get_coefficients_as_list.get_coefficients_as_list(no_of_unknowns)
if check_diagonal_dominant.is_diagonally_dominant(coefficient_list):
print("Computing...")
else:
print("Matrix failed to be... | true | true |
f7092877b036548f0ac6c9dcc5a5085434c79104 | 14,364 | py | Python | cinder/volume/flows/manager/manage_existing_snapshot.py | ISCAS-VDI/cinder-base | 9529102548beef074264aaef31fa8267db99df61 | [
"Apache-2.0"
] | null | null | null | cinder/volume/flows/manager/manage_existing_snapshot.py | ISCAS-VDI/cinder-base | 9529102548beef074264aaef31fa8267db99df61 | [
"Apache-2.0"
] | null | null | null | cinder/volume/flows/manager/manage_existing_snapshot.py | ISCAS-VDI/cinder-base | 9529102548beef074264aaef31fa8267db99df61 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Huawei Technologies Co., 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 applic... | 41.755814 | 79 | 0.61675 |
from oslo_config import cfg
from oslo_log import log as logging
import taskflow.engines
from taskflow.patterns import linear_flow
from taskflow.types import failure as ft
from cinder import exception
from cinder import flow_utils
from cinder.i18n import _, _LE, _LI
from cinder import objects
from cinder import quota
... | true | true |
f7092a6a9bede6870067db1af0ef8ca88e82b286 | 2,116 | py | Python | setup.py | ZLLentz/pcdscalc | 6279d3eb8bd62da0e5ac9d9f3b451519e5f13aea | [
"BSD-3-Clause-LBNL"
] | null | null | null | setup.py | ZLLentz/pcdscalc | 6279d3eb8bd62da0e5ac9d9f3b451519e5f13aea | [
"BSD-3-Clause-LBNL"
] | null | null | null | setup.py | ZLLentz/pcdscalc | 6279d3eb8bd62da0e5ac9d9f3b451519e5f13aea | [
"BSD-3-Clause-LBNL"
] | null | null | null | import sys
from os import path
from setuptools import find_packages, setup
import versioneer
min_version = (3, 6)
if sys.version_info < min_version:
error = """
pcdscalc does not support Python {0}.{1}.
Python {2}.{3} and above is required. Check your Python version like so:
python3 --version
This may be due ... | 28.594595 | 77 | 0.654537 | import sys
from os import path
from setuptools import find_packages, setup
import versioneer
min_version = (3, 6)
if sys.version_info < min_version:
error = """
pcdscalc does not support Python {0}.{1}.
Python {2}.{3} and above is required. Check your Python version like so:
python3 --version
This may be due ... | true | true |
f7092b83133107e338da2d33a559c9985e7b4a42 | 2,967 | py | Python | anchore_engine/db/db_accounts.py | ognjen-it/anchore-engine | 02eb4b01b544c2ec8755326731d31ec2b1f265f6 | [
"Apache-2.0"
] | 1 | 2019-06-27T08:47:48.000Z | 2019-06-27T08:47:48.000Z | anchore_engine/db/db_accounts.py | ognjen-it/anchore-engine | 02eb4b01b544c2ec8755326731d31ec2b1f265f6 | [
"Apache-2.0"
] | 4 | 2020-11-07T00:16:02.000Z | 2020-11-08T20:52:06.000Z | anchore_engine/db/db_accounts.py | mcburne/anchore-engine | de3c5bea6c0628fd611b027fc1d9e58b7e8d15a3 | [
"Apache-2.0"
] | 1 | 2019-11-23T03:39:28.000Z | 2019-11-23T03:39:28.000Z | """
Interface to the accounts table. Data format is dicts, not objects.
"""
from anchore_engine.db import Account, AccountTypes, AccountStates
from anchore_engine.db.entities.common import anchore_now
class AccountNotFoundError(Exception):
def __init__(self, account_name):
super(AccountNotFoundError, self... | 31.56383 | 175 | 0.713515 | from anchore_engine.db import Account, AccountTypes, AccountStates
from anchore_engine.db.entities.common import anchore_now
class AccountNotFoundError(Exception):
def __init__(self, account_name):
super(AccountNotFoundError, self).__init__('User account not found. Name={}'.format(account_name))
s... | true | true |
f7092c10da42e20fd36d0a193c9d2a7e83185c7d | 22,395 | py | Python | lib/utils/SegDataGenerator.py | Grusinator/BirdClassification | c78ca3dbf70c2509c79ca4641102a2d725084d2a | [
"MIT"
] | 1 | 2018-04-16T19:01:48.000Z | 2018-04-16T19:01:48.000Z | lib/utils/SegDataGenerator.py | Grusinator/BirdClassification | c78ca3dbf70c2509c79ca4641102a2d725084d2a | [
"MIT"
] | null | null | null | lib/utils/SegDataGenerator.py | Grusinator/BirdClassification | c78ca3dbf70c2509c79ca4641102a2d725084d2a | [
"MIT"
] | null | null | null | from keras.preprocessing.image import *
from keras.applications.imagenet_utils import preprocess_input
from keras import backend as K
from PIL import Image
import numpy as np
import os
#import cv2
def center_crop(x, center_crop_size, data_format, **kwargs):
if data_format == 'channels_first':
centerh, cen... | 43.067308 | 160 | 0.552936 | from keras.preprocessing.image import *
from keras.applications.imagenet_utils import preprocess_input
from keras import backend as K
from PIL import Image
import numpy as np
import os
def center_crop(x, center_crop_size, data_format, **kwargs):
if data_format == 'channels_first':
centerh, centerw = x.sha... | true | true |
f7092e1255d38618f9c2c9eca5f281dfe7bcef56 | 2,904 | py | Python | test/swig/Less.py | AyishaR/deepC | 1dc9707ef5ca9000fc13c3da7f1129685a83b494 | [
"Apache-2.0"
] | 223 | 2020-04-15T20:34:33.000Z | 2022-03-28T05:41:49.000Z | test/swig/Less.py | AyishaR/deepC | 1dc9707ef5ca9000fc13c3da7f1129685a83b494 | [
"Apache-2.0"
] | 42 | 2019-07-29T15:57:12.000Z | 2020-04-08T15:12:48.000Z | test/swig/Less.py | AyishaR/deepC | 1dc9707ef5ca9000fc13c3da7f1129685a83b494 | [
"Apache-2.0"
] | 58 | 2019-07-22T11:46:19.000Z | 2020-04-09T22:56:41.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... | 34.987952 | 87 | 0.632576 |
import common
import deepC.dnnc as dc
import numpy as np
import unittest
class LessTest(unittest.TestCase):
def setUp(self):
self.len = 24
self.np_a = np.random.randn(self.len).astype(np.float32)
self.np_b = np.random.randn(self.len).astype(np.float32)
self.dc_a = dc.array(list(se... | true | true |
f7092eb8bb29cd5ee13ba9193e8f20b7d4714b28 | 442 | py | Python | messier_objects/migrations/0003_auto_20200723_1441.py | DanielPDWalker/Astrophoto | 9a7ee59deb291617baa3ab8724b8ce5970e6ea9f | [
"MIT"
] | null | null | null | messier_objects/migrations/0003_auto_20200723_1441.py | DanielPDWalker/Astrophoto | 9a7ee59deb291617baa3ab8724b8ce5970e6ea9f | [
"MIT"
] | 12 | 2020-07-26T06:20:22.000Z | 2022-03-12T00:43:09.000Z | messier_objects/migrations/0003_auto_20200723_1441.py | DanielPDWalker/Astrophoto-API | 9a7ee59deb291617baa3ab8724b8ce5970e6ea9f | [
"MIT"
] | null | null | null | # Generated by Django 2.2.9 on 2020-07-23 13:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('messier_objects', '0002_auto_20200723_1438'),
]
operations = [
migrations.AlterField(
model_name='messierobject',
na... | 23.263158 | 92 | 0.631222 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('messier_objects', '0002_auto_20200723_1438'),
]
operations = [
migrations.AlterField(
model_name='messierobject',
name='photo',
field=models.ImageField(... | true | true |
f7092f97f43d8f03ca9070fa7e458673b7957cf3 | 9,168 | py | Python | src/config/api-server/vnc_cfg_api_server/tests/test_vnc_load_data.py | pawelzny/contrail-controller | 4950d3144cb8c422264ddb2a926cf4fe9e40b14d | [
"Apache-2.0"
] | null | null | null | src/config/api-server/vnc_cfg_api_server/tests/test_vnc_load_data.py | pawelzny/contrail-controller | 4950d3144cb8c422264ddb2a926cf4fe9e40b14d | [
"Apache-2.0"
] | null | null | null | src/config/api-server/vnc_cfg_api_server/tests/test_vnc_load_data.py | pawelzny/contrail-controller | 4950d3144cb8c422264ddb2a926cf4fe9e40b14d | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
#
import sys
import os
import logging
import json
import test_case
from vnc_api.exceptions import NoIdError, RefsExistError
from vnc_api.gen.resource_client import *
from vnc_api.gen.resource_xsd import *
from vnc_api.utils import obj_type_to_vnc_class
... | 36.672 | 121 | 0.571444 | import sys
import os
import logging
import json
import test_case
from vnc_api.exceptions import NoIdError, RefsExistError
from vnc_api.gen.resource_client import *
from vnc_api.gen.resource_xsd import *
from vnc_api.utils import obj_type_to_vnc_class
import shutil
sys.path.append("../common/tests")
from time import sl... | true | true |
f7092fce6743940e729d3c18cfe5b7cc2120c659 | 14,174 | py | Python | openapi_client/models/net_cdf_timeseries_rain.py | nens/threedi-api-client | 43b0eb1bd47310b1783f87f6ad8bfbfe0fb4d90a | [
"BSD-3-Clause"
] | null | null | null | openapi_client/models/net_cdf_timeseries_rain.py | nens/threedi-api-client | 43b0eb1bd47310b1783f87f6ad8bfbfe0fb4d90a | [
"BSD-3-Clause"
] | 16 | 2021-05-31T09:52:04.000Z | 2022-03-14T16:07:19.000Z | openapi_client/models/net_cdf_timeseries_rain.py | nens/threedi-api-client | 43b0eb1bd47310b1783f87f6ad8bfbfe0fb4d90a | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
"""
3Di API
3Di simulation API (latest version: 3.0) Framework release: 1.0.16 3Di core release: 2.0.11 deployed on: 07:33AM (UTC) on September 04, 2020 # noqa: E501
The version of the OpenAPI document: 3.0
Contact: info@nelen-schuurmans.nl
Generated by: https://openapi-gen... | 31.851685 | 245 | 0.607239 |
import pprint
import re
import six
from openapi_client.configuration import Configuration
class NetCDFTimeseriesRain(object):
openapi_types = {
'url': 'str',
'multiplier': 'float',
'simulation': 'str',
'offset': 'int',
'duration': 'int',
'timestamps': 'list[i... | true | true |
f70930266a9947b1e4d78fd8cb4f0ee3fd4e8801 | 7,397 | py | Python | src/api/dataflow/shared/datamanage/datamanage_helper.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 84 | 2021-06-30T06:20:23.000Z | 2022-03-22T03:05:49.000Z | src/api/dataflow/shared/datamanage/datamanage_helper.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 7 | 2021-06-30T06:21:16.000Z | 2022-03-29T07:36:13.000Z | src/api/dataflow/shared/datamanage/datamanage_helper.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 40 | 2021-06-30T06:21:26.000Z | 2022-03-29T12:42:26.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... | 33.931193 | 111 | 0.680681 |
import json
from django.utils.translation import ugettext as _
from dataflow.pizza_settings import KAFKA_OP_ROLE_NAME
from dataflow.shared.api.modules.datamanage import DatamanageApi
from dataflow.shared.api.util.api_driver import APIResponseUtil as res_util
from dataflow.shared.databus.databus_helper import Databus... | true | true |
f709302f607362b2ef2384ba1503f4713840f6d2 | 3,390 | py | Python | tic-tac.py | kobe81venum/tic-tac | c34841f31655bbfa85b3ae3ec548e99d0555589a | [
"MIT"
] | null | null | null | tic-tac.py | kobe81venum/tic-tac | c34841f31655bbfa85b3ae3ec548e99d0555589a | [
"MIT"
] | null | null | null | tic-tac.py | kobe81venum/tic-tac | c34841f31655bbfa85b3ae3ec548e99d0555589a | [
"MIT"
] | null | null | null | #main game section
# %%
plansza_do_gry = {'7':' ','8':' ','9':' ',
'4':' ','5':' ','6':' ',
'1':' ','2':' ','3':' '}
klawisze_gry=[]
for key in plansza_do_gry:
klawisze_gry.append(key)
# print(klawisze_gry)
def drukuj_plansze(pole):
print(f"{pole['7']} | {pole['8']} | {p... | 32.912621 | 90 | 0.484956 |
plansza_do_gry = {'7':' ','8':' ','9':' ',
'4':' ','5':' ','6':' ',
'1':' ','2':' ','3':' '}
klawisze_gry=[]
for key in plansza_do_gry:
klawisze_gry.append(key)
def drukuj_plansze(pole):
print(f"{pole['7']} | {pole['8']} | {pole['9']}")
print('- + - + -')
print(f... | true | true |
f70931652a71d14009a5d59d657e6473e79290df | 401 | py | Python | backend/thread_33988/wsgi.py | crowdbotics-apps/thread-33988 | 4a80fd631efce5785fcfadc057b4f90ac9a4749e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/thread_33988/wsgi.py | crowdbotics-apps/thread-33988 | 4a80fd631efce5785fcfadc057b4f90ac9a4749e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/thread_33988/wsgi.py | crowdbotics-apps/thread-33988 | 4a80fd631efce5785fcfadc057b4f90ac9a4749e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for thread_33988 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_... | 23.588235 | 78 | 0.790524 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'thread_33988.settings')
application = get_wsgi_application()
| true | true |
f709328daa9880d8b3313f573584ecdd16f15dea | 30,599 | py | Python | run_classifier.py | ksboy/superglue | 12b5bf6d729ba5b95b8a29682f6bfa584131ae9c | [
"Apache-2.0"
] | null | null | null | run_classifier.py | ksboy/superglue | 12b5bf6d729ba5b95b8a29682f6bfa584131ae9c | [
"Apache-2.0"
] | null | null | null | run_classifier.py | ksboy/superglue | 12b5bf6d729ba5b95b8a29682f6bfa584131ae9c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 47.513975 | 145 | 0.587013 |
from __future__ import absolute_import, division, print_function
import argparse
import logging
import os
import sys
import random
from tqdm import tqdm, trange
import numpy as np
from scipy.special import softmax
import torch
from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler,
... | true | true |
f7093398654a58555f899c5a5f2cf4cb9551af39 | 89 | py | Python | src/lesson_developer_tools/compileall_recursion_depth.py | jasonwee/asus-rt-n14uhp-mrtg | 4fa96c3406e32ea6631ce447db6d19d70b2cd061 | [
"Apache-2.0"
] | 3 | 2018-08-14T09:33:52.000Z | 2022-03-21T12:31:58.000Z | src/lesson_developer_tools/compileall_recursion_depth.py | jasonwee/asus-rt-n14uhp-mrtg | 4fa96c3406e32ea6631ce447db6d19d70b2cd061 | [
"Apache-2.0"
] | null | null | null | src/lesson_developer_tools/compileall_recursion_depth.py | jasonwee/asus-rt-n14uhp-mrtg | 4fa96c3406e32ea6631ce447db6d19d70b2cd061 | [
"Apache-2.0"
] | null | null | null | import compileall
import re
compileall.compile_dir(
'examples',
maxlevels=0,
)
| 9.888889 | 23 | 0.707865 | import compileall
import re
compileall.compile_dir(
'examples',
maxlevels=0,
)
| true | true |
f70933ecf281da6cda4b19389d3bb7d2e6f3df4b | 9,330 | py | Python | saleor/graphql/core/tests/test_graphql.py | fairhopeweb/saleor | 9ac6c22652d46ba65a5b894da5f1ba5bec48c019 | [
"CC-BY-4.0"
] | 15,337 | 2015-01-12T02:11:52.000Z | 2021-10-05T19:19:29.000Z | saleor/graphql/core/tests/test_graphql.py | fairhopeweb/saleor | 9ac6c22652d46ba65a5b894da5f1ba5bec48c019 | [
"CC-BY-4.0"
] | 7,486 | 2015-02-11T10:52:13.000Z | 2021-10-06T09:37:15.000Z | saleor/graphql/core/tests/test_graphql.py | aminziadna/saleor | 2e78fb5bcf8b83a6278af02551a104cfa555a1fb | [
"CC-BY-4.0"
] | 5,864 | 2015-01-16T14:52:54.000Z | 2021-10-05T23:01:15.000Z | from functools import partial
from unittest.mock import Mock, patch
import graphene
import pytest
from django.contrib.auth.models import AnonymousUser
from django.db.models import Q
from django.shortcuts import reverse
from graphql.error import GraphQLError
from graphql_relay import to_global_id
from ...core.utils im... | 29.432177 | 87 | 0.602572 | from functools import partial
from unittest.mock import Mock, patch
import graphene
import pytest
from django.contrib.auth.models import AnonymousUser
from django.db.models import Q
from django.shortcuts import reverse
from graphql.error import GraphQLError
from graphql_relay import to_global_id
from ...core.utils im... | true | true |
f70937bd4d44bb239528e4d0a4eeca186cddd1d3 | 6,375 | py | Python | sales_forecast/scoring/score.py | AghaSaad04/mlops-v2 | d312ae108c93bacfb3541968bb913874af060ab2 | [
"MIT"
] | null | null | null | sales_forecast/scoring/score.py | AghaSaad04/mlops-v2 | d312ae108c93bacfb3541968bb913874af060ab2 | [
"MIT"
] | null | null | null | sales_forecast/scoring/score.py | AghaSaad04/mlops-v2 | d312ae108c93bacfb3541968bb913874af060ab2 | [
"MIT"
] | null | null | null | import numpy
import os
import math
from azureml.core.model import Model
from azureml.core.dataset import Dataset
from inference_schema.schema_decorators \
import input_schema, output_schema
from inference_schema.parameter_types.numpy_parameter_type \
import NumpyParameterType
import keras
from keras.m... | 34.646739 | 217 | 0.642353 | import numpy
import os
import math
from azureml.core.model import Model
from azureml.core.dataset import Dataset
from inference_schema.schema_decorators \
import input_schema, output_schema
from inference_schema.parameter_types.numpy_parameter_type \
import NumpyParameterType
import keras
from keras.m... | true | true |
f70938f0d7e8390db2b65b8b2287c08bd4a5e663 | 16,026 | py | Python | plata/shop/migrations/0007_auto__add_field_order_billing_call_prefix__add_field_order_shipping_ca.py | DjangoAdminHackers/plata | 9f09431ef30a1e2022baa47cc89796c6d0879a25 | [
"BSD-3-Clause"
] | null | null | null | plata/shop/migrations/0007_auto__add_field_order_billing_call_prefix__add_field_order_shipping_ca.py | DjangoAdminHackers/plata | 9f09431ef30a1e2022baa47cc89796c6d0879a25 | [
"BSD-3-Clause"
] | null | null | null | plata/shop/migrations/0007_auto__add_field_order_billing_call_prefix__add_field_order_shipping_ca.py | DjangoAdminHackers/plata | 9f09431ef30a1e2022baa47cc89796c6d0879a25 | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Order.billing_call_prefix'
db.add_column(u'shop_order', 'billing_call_prefix', self.gf('dj... | 83.905759 | 195 | 0.567328 | import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column(u'shop_order', 'billing_call_prefix', self.gf('django.db.models.fields.CharField')(default='', max_length=100)... | true | true |
f70939b28be639a86193981881a264d901c31701 | 481 | py | Python | tests/test_signal/test_generator.py | mcanatalay/SIMULOC | af32c522887dec08a0815052a5878b5a595b8d44 | [
"MIT"
] | null | null | null | tests/test_signal/test_generator.py | mcanatalay/SIMULOC | af32c522887dec08a0815052a5878b5a595b8d44 | [
"MIT"
] | null | null | null | tests/test_signal/test_generator.py | mcanatalay/SIMULOC | af32c522887dec08a0815052a5878b5a595b8d44 | [
"MIT"
] | null | null | null | import unittest
from simuloc.signal import Generator
class GeneratorTestCase(unittest.TestCase):
"""GeneratorTestCase tests the generator class."""
def setUp(self):
"""Creates a instance of the generator class."""
self.cinst = Generator()
def tearDown(self):
pass
def test_noi... | 24.05 | 56 | 0.656965 | import unittest
from simuloc.signal import Generator
class GeneratorTestCase(unittest.TestCase):
def setUp(self):
self.cinst = Generator()
def tearDown(self):
pass
def test_noise(self):
self.assertTrue(self.cinst.noise(0.1) < 4)
if __name__ == '__main__':
unittest.main()
| true | true |
f70939c6c4c8363f7dcf9a0f1d8507a2c83f495d | 4,882 | py | Python | source/Project.py | victorchen276/CarND-Advanced-Lane-Lines | 436d81150107c181e3f328adfd3f1c31d6a5cb15 | [
"MIT"
] | 1 | 2019-01-20T10:59:36.000Z | 2019-01-20T10:59:36.000Z | source/Project.py | victorchen276/CarND-Advanced-Lane-Lines | 436d81150107c181e3f328adfd3f1c31d6a5cb15 | [
"MIT"
] | 4 | 2021-03-18T21:58:46.000Z | 2022-01-13T01:04:22.000Z | source/Project.py | victorchen276/CarND-Advanced-Lane-Lines | 436d81150107c181e3f328adfd3f1c31d6a5cb15 | [
"MIT"
] | 2 | 2019-01-20T10:59:39.000Z | 2019-08-04T13:08:14.000Z |
from source.camera import camera
from source.LaneDetect import LaneDetect
from moviepy.editor import VideoFileClip
import glob
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.image as mpimg
import numpy as np
import cv2
#
# def process_video(input_video_file):
# clip1 = V... | 35.897059 | 105 | 0.648914 |
from source.camera import camera
from source.LaneDetect import LaneDetect
from moviepy.editor import VideoFileClip
import glob
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.image as mpimg
import numpy as np
import cv2
def rgb2gray(rgb):
return np.dot(rgb[...,:3], [0.29... | true | true |
f7093aa21d3221a29bbe4a8c0a4d8dbde9443d8d | 3,322 | py | Python | doc/source/conf.py | lostmap/python-mistralclient | f77c1d23fb68b24d7406647b489f3f960026c46b | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | lostmap/python-mistralclient | f77c1d23fb68b24d7406647b489f3f960026c46b | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | lostmap/python-mistralclient | f77c1d23fb68b24d7406647b489f3f960026c46b | [
"Apache-2.0"
] | null | null | null | # Mistral documentation build configuration file
import os
import sys
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.... | 31.046729 | 79 | 0.689344 |
import os
import sys
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
sys.path.insert(0, os.path.abspath('../../'))
sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath('./'))
extensions = [
'sphinxcontrib.apidoc',
'openstackdocstheme',
]
apidoc_module_dir = '../../mistralc... | true | true |
f7093c16a586362247f066ec5e801495ab9cae9d | 547 | py | Python | reviews/migrations/0009_movie_poster_thumbnail.py | UrbanBogger/horrorexplosion | 3698e00a6899a5e8b224cd3d1259c3deb3a2ca80 | [
"MIT"
] | null | null | null | reviews/migrations/0009_movie_poster_thumbnail.py | UrbanBogger/horrorexplosion | 3698e00a6899a5e8b224cd3d1259c3deb3a2ca80 | [
"MIT"
] | 4 | 2020-06-05T18:21:18.000Z | 2021-06-10T20:17:31.000Z | reviews/migrations/0009_movie_poster_thumbnail.py | UrbanBogger/horrorexplosion | 3698e00a6899a5e8b224cd3d1259c3deb3a2ca80 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-07-08 17:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reviews', '0008_auto_20180623_2009'),
]
operations = [
migrations.AddField(... | 26.047619 | 139 | 0.650823 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reviews', '0008_auto_20180623_2009'),
]
operations = [
migrations.AddField(
model_name='movie',
name='poster_thumbnail',
... | true | true |
f7093def5323b66ffaaea55ff027d9e85613d2dd | 42,660 | py | Python | model/stage.py | Lee-Ft/RHA | 8a832a9afebc9204148bbd340c31e26c83138024 | [
"MIT"
] | 3 | 2021-04-23T11:53:13.000Z | 2022-02-11T12:29:34.000Z | model/stage.py | Lee-Ft/RHA | 8a832a9afebc9204148bbd340c31e26c83138024 | [
"MIT"
] | 2 | 2022-02-11T12:43:03.000Z | 2022-02-14T15:18:39.000Z | model/stage.py | Lee-Ft/RHA | 8a832a9afebc9204148bbd340c31e26c83138024 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import pprint
from collections import defaultdict
from .context_query_attention import StructuredAttention
from .encoder import StackedEncoder
from .cnn import DepthwiseSeparableConv
from .model_utils import save_pickle, mask_logits, ... | 52.92804 | 121 | 0.560267 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import pprint
from collections import defaultdict
from .context_query_attention import StructuredAttention
from .encoder import StackedEncoder
from .cnn import DepthwiseSeparableConv
from .model_utils import save_pickle, mask_logits, ... | true | true |
f7093e4a3f79f87ff0d626827bd64f15c5c476cf | 8,085 | py | Python | legacy/20210120/prun_table.py | artec-kk/Studth | 52cfa9c61355852163e1e4b42832480f51fda410 | [
"MIT"
] | 1 | 2020-12-24T08:17:52.000Z | 2020-12-24T08:17:52.000Z | legacy/20210120/prun_table.py | Nyanyan/Studth | d603f209d3125b3eafa875d47bd72c3607454391 | [
"MIT"
] | 1 | 2021-04-19T09:08:02.000Z | 2021-04-19T09:08:02.000Z | legacy/20210120/prun_table.py | artec-kk/Studth | 52cfa9c61355852163e1e4b42832480f51fda410 | [
"MIT"
] | 1 | 2021-03-11T09:26:49.000Z | 2021-03-11T09:26:49.000Z | from basic_functions import *
import csv
from collections import deque
inf = 1000
def table_phase0():
trans_ep = []
with open('trans_ep_phase0.csv', mode='r') as f:
for line in map(str.strip, f):
trans_ep.append([int(i) for i in line.replace('\n', '').split(',')])
trans = []
w... | 42.109375 | 85 | 0.557699 | from basic_functions import *
import csv
from collections import deque
inf = 1000
def table_phase0():
trans_ep = []
with open('trans_ep_phase0.csv', mode='r') as f:
for line in map(str.strip, f):
trans_ep.append([int(i) for i in line.replace('\n', '').split(',')])
trans = []
w... | true | true |
f7093e4ef346f30cf5169badac19ffab90a46d22 | 1,314 | py | Python | past_archive/swexpert/1979(whereToIn).py | DongHyunByun/algorithm_practice | c726c69d35306d23467f4af6e10f2db6fdc68234 | [
"MIT"
] | null | null | null | past_archive/swexpert/1979(whereToIn).py | DongHyunByun/algorithm_practice | c726c69d35306d23467f4af6e10f2db6fdc68234 | [
"MIT"
] | null | null | null | past_archive/swexpert/1979(whereToIn).py | DongHyunByun/algorithm_practice | c726c69d35306d23467f4af6e10f2db6fdc68234 | [
"MIT"
] | null | null | null | def numOfAbled(L,k):
hori=0
verti=0
for i in range(len(L)):
for j in range(len(L)-k+1):
num=0
for m in range(k):
if L[i][j+m]!=1:
break
else :
num+=1
if num==k:
if j==len(L)-k:... | 25.269231 | 51 | 0.314307 | def numOfAbled(L,k):
hori=0
verti=0
for i in range(len(L)):
for j in range(len(L)-k+1):
num=0
for m in range(k):
if L[i][j+m]!=1:
break
else :
num+=1
if num==k:
if j==len(L)-k:... | true | true |
f7093f4912a687d4e7ec0a6c86c92b455f7b055d | 274,474 | py | Python | rsl_comm_py/shearwater_registers.py | RedshiftLabsPtyLtd/rsl_comm_py | e53b4e85079898c894dac25842a08bcc303edfbb | [
"MIT"
] | null | null | null | rsl_comm_py/shearwater_registers.py | RedshiftLabsPtyLtd/rsl_comm_py | e53b4e85079898c894dac25842a08bcc303edfbb | [
"MIT"
] | null | null | null | rsl_comm_py/shearwater_registers.py | RedshiftLabsPtyLtd/rsl_comm_py | e53b4e85079898c894dac25842a08bcc303edfbb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Author: Dr. Konstantin Selyunin
# License: MIT
# Created: 2020.08.19
import logging
import os.path
import struct
from abc import abstractmethod, ABC
from typing import Union, Tuple
from .rsl_xml_svd.rsl_svd_parser import RslSvdParser
class ShearWaterRegisters(ABC):
def __init__(self, ... | 40.66884 | 287 | 0.63888 |
import logging
import os.path
import struct
from abc import abstractmethod, ABC
from typing import Union, Tuple
from .rsl_xml_svd.rsl_svd_parser import RslSvdParser
class ShearWaterRegisters(ABC):
def __init__(self, **kwargs):
self.svd_parser = RslSvdParser(svd_file=ShearWaterRegisters.find_svd('shea... | true | true |
f7093fe62cd2fc34b1c1b4274b909f0daecbb510 | 418 | py | Python | day-3/binary_converter.py | MarkGhebrial/advent-of-code-2021 | eb38b152f41a61e4d92578fe1187636f22e82d6c | [
"MIT"
] | null | null | null | day-3/binary_converter.py | MarkGhebrial/advent-of-code-2021 | eb38b152f41a61e4d92578fe1187636f22e82d6c | [
"MIT"
] | null | null | null | day-3/binary_converter.py | MarkGhebrial/advent-of-code-2021 | eb38b152f41a61e4d92578fe1187636f22e82d6c | [
"MIT"
] | null | null | null | def binaryToInt (string: str, oneChar = "1", zeroChar = "0"):
out = 0
for i in range(len(string)):
currentDigit = None
if string[len(string) - 1 - i] == oneChar:
currentDigit = 1
elif string[len(string) - 1 - i] == zeroChar:
currentDigit = 0
out +... | 29.857143 | 61 | 0.538278 | def binaryToInt (string: str, oneChar = "1", zeroChar = "0"):
out = 0
for i in range(len(string)):
currentDigit = None
if string[len(string) - 1 - i] == oneChar:
currentDigit = 1
elif string[len(string) - 1 - i] == zeroChar:
currentDigit = 0
out +... | true | true |
f70940369734952cf51e11dce622dd3ae73eaef4 | 4,192 | py | Python | tests/test_poetry.py | radek-sprta/poetry | c57e1ddfd50da4e4ec60c3c27152811e07bdba2a | [
"MIT"
] | null | null | null | tests/test_poetry.py | radek-sprta/poetry | c57e1ddfd50da4e4ec60c3c27152811e07bdba2a | [
"MIT"
] | null | null | null | tests/test_poetry.py | radek-sprta/poetry | c57e1ddfd50da4e4ec60c3c27152811e07bdba2a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from poetry.poetry import Poetry
from poetry.utils._compat import Path
from poetry.utils.toml_file import TomlFile
fixtures_dir = Path(__file__).parent / "fixtures"
def test_poetry():
poetry = Poetry.create(s... | 32.75 | 87 | 0.666508 | from __future__ import absolute_import
from __future__ import unicode_literals
from poetry.poetry import Poetry
from poetry.utils._compat import Path
from poetry.utils.toml_file import TomlFile
fixtures_dir = Path(__file__).parent / "fixtures"
def test_poetry():
poetry = Poetry.create(str(fixtures_dir / "sampl... | true | true |
f7094221dcff97c2f472e146693d17b871a4455a | 5,032 | py | Python | SLpackage/private/pacbio/pythonpkgs/pbreports/lib/python2.7/site-packages/pbreports/report/barcode_ccs.py | fanglab/6mASCOPE | 3f1fdcb7693ff152f17623ce549526ec272698b1 | [
"BSD-3-Clause"
] | 5 | 2022-02-20T07:10:02.000Z | 2022-03-18T17:47:53.000Z | SLpackage/private/pacbio/pythonpkgs/pbreports/lib/python2.7/site-packages/pbreports/report/barcode_ccs.py | fanglab/6mASCOPE | 3f1fdcb7693ff152f17623ce549526ec272698b1 | [
"BSD-3-Clause"
] | null | null | null | SLpackage/private/pacbio/pythonpkgs/pbreports/lib/python2.7/site-packages/pbreports/report/barcode_ccs.py | fanglab/6mASCOPE | 3f1fdcb7693ff152f17623ce549526ec272698b1 | [
"BSD-3-Clause"
] | null | null | null | #! python
"""
Modified version of barcode report for use on CCS inputs
"""
from pprint import pformat
import functools
import logging
import json
import os.path as op
import sys
from pbcommand.models import DataStore, FileTypes
from pbcommand.models.report import PlotGroup
from pbcommand.cli import pbparser_runner
f... | 34 | 101 | 0.67031 |
from pprint import pformat
import functools
import logging
import json
import os.path as op
import sys
from pbcommand.models import DataStore, FileTypes
from pbcommand.models.report import PlotGroup
from pbcommand.cli import pbparser_runner
from pbcommand.utils import setup_log
from pbcore.io import ConsensusReadSet... | true | true |
f7094232e1c00bad93777f3c61dca4a3fa60846e | 3,130 | py | Python | custom-recipes/amazon-comprehend-nlp-language-detection/recipe.py | dataiku/dss-plugin-amazon-comprehend | 95ce7bc560209f849a55849f8846bd6dbc0ec6f5 | [
"Apache-2.0"
] | 2 | 2020-05-15T16:29:47.000Z | 2021-12-10T18:47:31.000Z | custom-recipes/amazon-comprehend-nlp-language-detection/recipe.py | dataiku/dss-plugin-amazon-comprehend-nlp | 95ce7bc560209f849a55849f8846bd6dbc0ec6f5 | [
"Apache-2.0"
] | 3 | 2020-04-23T18:39:51.000Z | 2020-10-14T16:45:05.000Z | custom-recipes/amazon-comprehend-nlp-language-detection/recipe.py | dataiku/dss-plugin-amazon-comprehend | 95ce7bc560209f849a55849f8846bd6dbc0ec6f5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from typing import List, Dict, AnyStr
from retry import retry
from ratelimit import limits, RateLimitException
import dataiku
from dataiku.customrecipe import get_recipe_config, get_input_names_for_role, get_output_names_for_role
from plugin_io_utils import ErrorHandlingEnum, validate_column_... | 37.710843 | 103 | 0.741853 | from typing import List, Dict, AnyStr
from retry import retry
from ratelimit import limits, RateLimitException
import dataiku
from dataiku.customrecipe import get_recipe_config, get_input_names_for_role, get_output_names_for_role
from plugin_io_utils import ErrorHandlingEnum, validate_column_input
from dku_io_utils ... | true | true |
f709424b1033001a56abcfb6869bc07c967d7d91 | 720 | py | Python | src/examples_in_my_book/general_problems/strings/find_edit_distance.py | lucidrohit/Over-100-Exercises-Python-and-Algorithms | 62345c7d7c9cc2269f240d134189645fc96c3e80 | [
"MIT"
] | 2 | 2022-01-07T11:46:32.000Z | 2022-02-24T08:44:31.000Z | src/examples_in_my_book/general_problems/strings/find_edit_distance.py | lucidrohit/Over-100-Exercises-Python-and-Algorithms | 62345c7d7c9cc2269f240d134189645fc96c3e80 | [
"MIT"
] | null | null | null | src/examples_in_my_book/general_problems/strings/find_edit_distance.py | lucidrohit/Over-100-Exercises-Python-and-Algorithms | 62345c7d7c9cc2269f240d134189645fc96c3e80 | [
"MIT"
] | 1 | 2021-10-01T15:35:05.000Z | 2021-10-01T15:35:05.000Z | #!/usr/bin/python3
# mari von steinkirch @2013
# steinkirch at gmail
def find_edit_distance(str1, str2):
''' computes the edit distance between two strings '''
m = len(str1)
n = len(str2)
diff = lambda c1, c2: 0 if c1 == c2 else 1
E = [[0] * (n + 1) for i in range(m + 1)]
for i in range(m + 1):
E[i][0] = i
f... | 20.571429 | 88 | 0.575 |
def find_edit_distance(str1, str2):
m = len(str1)
n = len(str2)
diff = lambda c1, c2: 0 if c1 == c2 else 1
E = [[0] * (n + 1) for i in range(m + 1)]
for i in range(m + 1):
E[i][0] = i
for j in range(1, n + 1):
E[0][j] = j
for i in range(1, m + 1):
for j in range(1, n + 1):
E[i][j] = min(E[i-1][j] + 1,... | true | true |
f70942b36a139c80f233905649b19f8e01e0b8a4 | 7,712 | py | Python | cats_and_dogs_classification.py | janewen134/catsdogs | 051dc0d4bf695ca2db03df6fc3cf758331df4aaa | [
"MIT"
] | null | null | null | cats_and_dogs_classification.py | janewen134/catsdogs | 051dc0d4bf695ca2db03df6fc3cf758331df4aaa | [
"MIT"
] | null | null | null | cats_and_dogs_classification.py | janewen134/catsdogs | 051dc0d4bf695ca2db03df6fc3cf758331df4aaa | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Cats and Dogs Classification
# Data Loading and Exploring
# In[1]:
import os
base_dir = './cats_and_dogs_filtered'
train_dir = os.path.join(base_dir, 'train')
validation_dir = os.path.join(base_dir, 'validation')
# cat training pictures
train_cats_dir = os.path.join(train... | 27.741007 | 206 | 0.741701 |
import os
base_dir = './cats_and_dogs_filtered'
train_dir = os.path.join(base_dir, 'train')
validation_dir = os.path.join(base_dir, 'validation')
train_cats_dir = os.path.join(train_dir, 'cats')
train_dogs_dir = os.path.join(train_dir, 'dogs')
validation_cats_dir = os.path.join(validation_dir, 'cats')
validati... | true | true |
f709437e54330c11d20bceb3045c97b073567f65 | 4,211 | py | Python | data_preparation/rebuild_limited_train/utils.py | dweekly/libri-light | 2a181b2482e0e3a539bf4d8b387b1838fdbfacac | [
"MIT"
] | 246 | 2019-12-19T21:40:48.000Z | 2022-03-30T12:40:22.000Z | data_preparation/rebuild_limited_train/utils.py | dweekly/libri-light | 2a181b2482e0e3a539bf4d8b387b1838fdbfacac | [
"MIT"
] | 11 | 2020-01-17T14:45:05.000Z | 2021-09-20T21:53:27.000Z | data_preparation/rebuild_limited_train/utils.py | dweekly/libri-light | 2a181b2482e0e3a539bf4d8b387b1838fdbfacac | [
"MIT"
] | 48 | 2019-12-20T16:34:12.000Z | 2022-03-26T13:14:35.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import pathlib
from collections import namedtuple
import torchaudio
import shutil
Speaker = namedtuple('Speaker', ['id', 'gender', 'subset'])
FileRecord = namedtuple(
'FileRecord', ['fname', 'length', 'speaker', 'book', 'text_file'])
def get... | 30.078571 | 96 | 0.632391 | import pathlib
from collections import namedtuple
import torchaudio
import shutil
Speaker = namedtuple('Speaker', ['id', 'gender', 'subset'])
FileRecord = namedtuple(
'FileRecord', ['fname', 'length', 'speaker', 'book', 'text_file'])
def get_speakers(speaker_path):
all_speakers = []
with open(speaker_pa... | true | true |
f70943c6ac3aca9a74aba66e5048de86b69d40c3 | 201 | py | Python | code/global_vars.py | btaille/sincere | dd1c34916ddcdc5ceb2799d64b17e80cdf1a5b31 | [
"Apache-2.0"
] | 12 | 2020-10-22T13:04:36.000Z | 2021-12-30T10:34:28.000Z | code/global_vars.py | btaille/sincere | dd1c34916ddcdc5ceb2799d64b17e80cdf1a5b31 | [
"Apache-2.0"
] | null | null | null | code/global_vars.py | btaille/sincere | dd1c34916ddcdc5ceb2799d64b17e80cdf1a5b31 | [
"Apache-2.0"
] | 2 | 2020-11-27T12:23:22.000Z | 2021-11-16T09:17:06.000Z | import os
PROJECT_DIR = os.path.abspath(os.pardir)
RUN_DIR = os.path.join(PROJECT_DIR, "runs/")
DATA_DIR = os.path.join(PROJECT_DIR, "data/")
EMBEDDINGS_DIR = os.path.join(PROJECT_DIR, "embeddings/")
| 28.714286 | 57 | 0.746269 | import os
PROJECT_DIR = os.path.abspath(os.pardir)
RUN_DIR = os.path.join(PROJECT_DIR, "runs/")
DATA_DIR = os.path.join(PROJECT_DIR, "data/")
EMBEDDINGS_DIR = os.path.join(PROJECT_DIR, "embeddings/")
| true | true |
f70943e4a0c52d5d4276cd23f2fe2071c7a54270 | 1,185 | py | Python | 05-1class-func/tagger.py | banjin/FluentPython-example | 268866ef52da4109072088778953d7ed47132001 | [
"MIT"
] | 5,651 | 2015-01-06T21:58:46.000Z | 2022-03-31T13:39:07.000Z | 05-1class-func/tagger.py | banjin/FluentPython-example | 268866ef52da4109072088778953d7ed47132001 | [
"MIT"
] | 42 | 2016-12-11T19:17:11.000Z | 2021-11-23T19:41:16.000Z | 05-1class-func/tagger.py | banjin/FluentPython-example | 268866ef52da4109072088778953d7ed47132001 | [
"MIT"
] | 2,394 | 2015-01-18T10:57:38.000Z | 2022-03-31T11:41:12.000Z |
"""
# BEGIN TAG_DEMO
>>> tag('br') # <1>
'<br />'
>>> tag('p', 'hello') # <2>
'<p>hello</p>'
>>> print(tag('p', 'hello', 'world'))
<p>hello</p>
<p>world</p>
>>> tag('p', 'hello', id=33) # <3>
'<p id="33">hello</p>'
>>> print(tag('p', 'hello', 'world', cls='sidebar')) # <4>
<p class="sidebar">hello</p>
<p class="s... | 26.333333 | 68 | 0.491139 |
def tag(name, *content, cls=None, **attrs):
if cls is not None:
attrs['class'] = cls
if attrs:
attr_str = ''.join(' %s="%s"' % (attr, value)
for attr, value
in sorted(attrs.items()))
else:
attr_str = ''
if content:
... | true | true |
f7094645f95735c801cc8b9f916dc205d0f15abb | 470 | py | Python | dp/longestPalindromicSubsequence/Solution.py | shahbagdadi/py-algo-n-ds | ff689534b771ddb4869b001b20a0e21b4896bb0a | [
"MIT"
] | null | null | null | dp/longestPalindromicSubsequence/Solution.py | shahbagdadi/py-algo-n-ds | ff689534b771ddb4869b001b20a0e21b4896bb0a | [
"MIT"
] | null | null | null | dp/longestPalindromicSubsequence/Solution.py | shahbagdadi/py-algo-n-ds | ff689534b771ddb4869b001b20a0e21b4896bb0a | [
"MIT"
] | null | null | null | from functools import lru_cache
class Solution:
def longestPalindromeSubseq(self, s: str) -> int:
@lru_cache(None)
def helper(b,e):
print(b,e)
if b > e : return 0
if b == e : return 1
if s[b] == s[e] :
return helper(b+1,e-1) + 2
... | 26.111111 | 53 | 0.52766 | from functools import lru_cache
class Solution:
def longestPalindromeSubseq(self, s: str) -> int:
@lru_cache(None)
def helper(b,e):
print(b,e)
if b > e : return 0
if b == e : return 1
if s[b] == s[e] :
return helper(b+1,e-1) + 2
... | true | true |
f70946ff7a42e2971d93f7c6e7bd44b2b8487ee5 | 3,501 | py | Python | run_with_submitit.py | haozy008/detr_transformer | f2cca52a1ea97a31c9497451714373bb691589e9 | [
"Apache-2.0"
] | 22 | 2020-09-20T15:08:57.000Z | 2022-03-27T14:06:09.000Z | run_with_submitit.py | haozy008/detr_transformer | f2cca52a1ea97a31c9497451714373bb691589e9 | [
"Apache-2.0"
] | 4 | 2020-12-16T15:52:13.000Z | 2021-08-14T02:40:07.000Z | run_with_submitit.py | haozy008/detr_transformer | f2cca52a1ea97a31c9497451714373bb691589e9 | [
"Apache-2.0"
] | 7 | 2020-08-24T03:12:55.000Z | 2022-03-27T14:06:34.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
A script to run multinode training with submitit.
"""
import argparse
import os
import uuid
from pathlib import Path
import main as detection
import submitit
def parse_args():
detection_parser = detection.get_args_parser()
parser = ar... | 31.258929 | 102 | 0.677235 | import argparse
import os
import uuid
from pathlib import Path
import main as detection
import submitit
def parse_args():
detection_parser = detection.get_args_parser()
parser = argparse.ArgumentParser("Submitit for detection", parents=[detection_parser])
parser.add_argument("--ngpus", default=8, type=in... | true | true |
f70948eb04aae6c332dfeb082bf8b190c4d271e1 | 11,461 | py | Python | homeassistant/components/zha/entity.py | mib1185/core | b17d4ac65cde9a27ff6032d70b148792e5eba8df | [
"Apache-2.0"
] | null | null | null | homeassistant/components/zha/entity.py | mib1185/core | b17d4ac65cde9a27ff6032d70b148792e5eba8df | [
"Apache-2.0"
] | null | null | null | homeassistant/components/zha/entity.py | mib1185/core | b17d4ac65cde9a27ff6032d70b148792e5eba8df | [
"Apache-2.0"
] | null | null | null | """Entity for Zigbee Home Automation."""
from __future__ import annotations
import asyncio
from collections.abc import Callable
import functools
import logging
from typing import TYPE_CHECKING, Any
from homeassistant.const import ATTR_NAME
from homeassistant.core import CALLBACK_TYPE, Event, callback
from homeassista... | 33.609971 | 88 | 0.639997 | from __future__ import annotations
import asyncio
from collections.abc import Callable
import functools
import logging
from typing import TYPE_CHECKING, Any
from homeassistant.const import ATTR_NAME
from homeassistant.core import CALLBACK_TYPE, Event, callback
from homeassistant.helpers import entity
from homeassista... | true | true |
f70949c899c61f3c27374377db66bdcead46f9ca | 1,408 | py | Python | exmail/client/api/department.py | ni-ning/exmail-sdk | 8ffefd70c46c4df755e0ab25559aeb0bb4e9b194 | [
"MIT"
] | 5 | 2019-11-14T03:23:06.000Z | 2021-12-23T02:24:15.000Z | exmail/client/api/department.py | ni-ning/exmail-sdk | 8ffefd70c46c4df755e0ab25559aeb0bb4e9b194 | [
"MIT"
] | null | null | null | exmail/client/api/department.py | ni-ning/exmail-sdk | 8ffefd70c46c4df755e0ab25559aeb0bb4e9b194 | [
"MIT"
] | 1 | 2021-01-11T08:33:00.000Z | 2021-01-11T08:33:00.000Z | # -*- coding:utf-8 -*-
from __future__ import absolute_import, unicode_literals
from exmail.client.api.base import EmailBaseAPI
class Department(EmailBaseAPI):
def create(self, department_data):
'''
创建部门
:param department_data: 创建部门所需数据
:return:
'''
return self._... | 20.405797 | 56 | 0.497159 | from __future__ import absolute_import, unicode_literals
from exmail.client.api.base import EmailBaseAPI
class Department(EmailBaseAPI):
def create(self, department_data):
return self._post(
'/department/create',
data=department_data
)
def update(self, department_dat... | true | true |
f7094a287be0868ea1021a5b882a2a214996f97e | 41,174 | py | Python | src/transformers/modeling_albert.py | dom-s/transformers | 66ef8faf6ae805aeb4e71075d4da6eab7be3bc26 | [
"Apache-2.0"
] | 1 | 2020-03-06T02:41:33.000Z | 2020-03-06T02:41:33.000Z | src/transformers/modeling_albert.py | BlueSkyBubble/transformers | 83446a88d902661fab12bf8c37a1aa2845cdca5f | [
"Apache-2.0"
] | null | null | null | src/transformers/modeling_albert.py | BlueSkyBubble/transformers | 83446a88d902661fab12bf8c37a1aa2845cdca5f | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and the HuggingFace Inc. 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
#
# U... | 46.107503 | 148 | 0.670253 |
import logging
import math
import os
import torch
import torch.nn as nn
from torch.nn import CrossEntropyLoss, MSELoss
from transformers.configuration_albert import AlbertConfig
from transformers.modeling_bert import ACT2FN, BertEmbeddings, BertSelfAttention, prune_linear_layer
from transformers.modeling_utils impor... | true | true |
f7094bfea756491c4f21b1c24a374dfa1e15b117 | 1,134 | py | Python | logreader.py | trim-uec/notify | c763d87d8654ce46366e9d5bf4d30191fc0db5bf | [
"MIT"
] | null | null | null | logreader.py | trim-uec/notify | c763d87d8654ce46366e9d5bf4d30191fc0db5bf | [
"MIT"
] | null | null | null | logreader.py | trim-uec/notify | c763d87d8654ce46366e9d5bf4d30191fc0db5bf | [
"MIT"
] | null | null | null | import datetime as dt
import os
# ログファイル差分チェッカー
# ファイル名を受け取り、update()実行ごとに差分を返す
# 更新実行時の時間をもつ
# 更新にかかった総所要時間の計測はせず、上のレイヤーに任せる
# 監視対象のファイルは行を追加する形で情報が増えていくものとする
class LogReader:
# filename, last_update, tail_ix
def __init__(self, filename):
self.filename = filename
self.last_update = dt.datet... | 31.5 | 71 | 0.65873 | import datetime as dt
import os
class LogReader:
def __init__(self, filename):
self.filename = filename
self.last_update = dt.datetime.now()
assert os.path.isfile(filename), '存在しないファイルを指定しました'
with open(self.filename, 'r') as f:
lines = f.readlines()
self.... | true | true |
f7094c34c8b66e96e77d0858e274b7b1eede1bf8 | 594 | py | Python | demo/blog/migrations/0002_auto_20160420_2154.py | andrewebdev/django-ostinato | 2c435dea23319be6e9011e7381afca2b4092b5a2 | [
"MIT"
] | 5 | 2015-01-28T09:56:48.000Z | 2020-05-22T21:07:30.000Z | demo/blog/migrations/0002_auto_20160420_2154.py | andrewebdev/django-ostinato | 2c435dea23319be6e9011e7381afca2b4092b5a2 | [
"MIT"
] | 18 | 2015-02-03T15:37:22.000Z | 2020-06-05T16:41:15.000Z | demo/blog/migrations/0002_auto_20160420_2154.py | andrewebdev/django-ostinato | 2c435dea23319be6e9011e7381afca2b4092b5a2 | [
"MIT"
] | 2 | 2015-02-23T19:34:59.000Z | 2017-01-22T02:10:12.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-20 21:54
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 28.285714 | 210 | 0.619529 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='entry',
name='state',
field=models.C... | true | true |
f7094d7d2b07f9b1f3da84df7d2308db1dff55eb | 1,474 | py | Python | benchmark/experimental_vectors.py | guyang3532/text | e2fc987ff6a002018040cffac5e0d61c3d0b06c6 | [
"BSD-3-Clause"
] | null | null | null | benchmark/experimental_vectors.py | guyang3532/text | e2fc987ff6a002018040cffac5e0d61c3d0b06c6 | [
"BSD-3-Clause"
] | null | null | null | benchmark/experimental_vectors.py | guyang3532/text | e2fc987ff6a002018040cffac5e0d61c3d0b06c6 | [
"BSD-3-Clause"
] | null | null | null | import time
import torch
from torchtext.experimental.datasets import AG_NEWS
from torchtext.experimental.vectors import FastText as FastTextExperimental
from torchtext.vocab import FastText
def benchmark_experimental_vectors():
def _run_benchmark_lookup(tokens, vector):
t0 = time.monotonic()
for ... | 30.708333 | 75 | 0.713026 | import time
import torch
from torchtext.experimental.datasets import AG_NEWS
from torchtext.experimental.vectors import FastText as FastTextExperimental
from torchtext.vocab import FastText
def benchmark_experimental_vectors():
def _run_benchmark_lookup(tokens, vector):
t0 = time.monotonic()
for ... | true | true |
f7094f7293ea2a022771f9ba3ca7252c82e92c07 | 6,012 | py | Python | tacker/db/migration/cli.py | mail2nsrajesh/tacker | dce6690659836c2885f1cf8227c19be234f8fe25 | [
"Apache-2.0"
] | 1 | 2020-10-13T05:20:38.000Z | 2020-10-13T05:20:38.000Z | tacker/db/migration/cli.py | mail2nsrajesh/tacker | dce6690659836c2885f1cf8227c19be234f8fe25 | [
"Apache-2.0"
] | null | null | null | tacker/db/migration/cli.py | mail2nsrajesh/tacker | dce6690659836c2885f1cf8227c19be234f8fe25 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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 a... | 33.775281 | 79 | 0.66018 |
import os
from alembic import command as alembic_command
from alembic import config as alembic_config
from alembic import script as alembic_script
from alembic import util as alembic_util
from oslo_config import cfg
from tacker.db.migration.models import head from tacker.db.migration import purge_tables
HEAD_FILEN... | true | true |
f70950777437bd2b88e786c6e3486e6043ad9e0b | 49 | py | Python | exercises/sublist/sublist.py | seemaullal/python-exercisms | 43a10cc0bff8c9b095c9c0440ac2eb4b97994c58 | [
"MIT"
] | null | null | null | exercises/sublist/sublist.py | seemaullal/python-exercisms | 43a10cc0bff8c9b095c9c0440ac2eb4b97994c58 | [
"MIT"
] | null | null | null | exercises/sublist/sublist.py | seemaullal/python-exercisms | 43a10cc0bff8c9b095c9c0440ac2eb4b97994c58 | [
"MIT"
] | null | null | null | def check_lists(l1, l2):
def contains(l1, l2):
| 9.8 | 24 | 0.673469 | def check_lists(l1, l2):
def contains(l1, l2):
| false | true |
f7095169f139557a45e67599ce006c31ba8e3471 | 157 | py | Python | python/pip_package/__init__.py | kanishkg/lab | a9a3b5c38ad160ffd2e77a3af3e13c6e66eed457 | [
"CC-BY-4.0"
] | 16 | 2019-02-27T22:37:25.000Z | 2021-11-08T12:39:33.000Z | python/pip_package/__init__.py | kanishkg/lab | a9a3b5c38ad160ffd2e77a3af3e13c6e66eed457 | [
"CC-BY-4.0"
] | null | null | null | python/pip_package/__init__.py | kanishkg/lab | a9a3b5c38ad160ffd2e77a3af3e13c6e66eed457 | [
"CC-BY-4.0"
] | 7 | 2019-05-28T06:26:26.000Z | 2021-11-27T16:33:55.000Z | """Loads deepmind_lab.so."""
import imp
import pkg_resources
imp.load_dynamic(__name__, pkg_resources.resource_filename(
__name__, 'deepmind_lab.so'))
| 19.625 | 59 | 0.77707 |
import imp
import pkg_resources
imp.load_dynamic(__name__, pkg_resources.resource_filename(
__name__, 'deepmind_lab.so'))
| true | true |
f70951dfc2d5ffb763356ce62e348b225daba092 | 468 | py | Python | sigmapiweb/apps/PartyListV2/migrations/0003_partyguest_hasprepartyaccess.py | Jacobvs/sigmapi-web | ca8d5a5294385fe5f4634c483a1278df904e2f85 | [
"MIT"
] | null | null | null | sigmapiweb/apps/PartyListV2/migrations/0003_partyguest_hasprepartyaccess.py | Jacobvs/sigmapi-web | ca8d5a5294385fe5f4634c483a1278df904e2f85 | [
"MIT"
] | null | null | null | sigmapiweb/apps/PartyListV2/migrations/0003_partyguest_hasprepartyaccess.py | Jacobvs/sigmapi-web | ca8d5a5294385fe5f4634c483a1278df904e2f85 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-05-05 02:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("PartyListV2", "0002_restrictedguest"),
]
operations = [
migrations.AddField... | 22.285714 | 53 | 0.630342 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("PartyListV2", "0002_restrictedguest"),
]
operations = [
migrations.AddField(
model_name="partyguest",
name="hasPrepartyAcces... | true | true |
f7095294a578333aea0d7d4f635861b75965cc3c | 1,633 | py | Python | ex41.py | Poethalphyu/python_exercises | c5a02923f3198a7715fb02704e8c2a2c6e3eadf5 | [
"MIT"
] | null | null | null | ex41.py | Poethalphyu/python_exercises | c5a02923f3198a7715fb02704e8c2a2c6e3eadf5 | [
"MIT"
] | null | null | null | ex41.py | Poethalphyu/python_exercises | c5a02923f3198a7715fb02704e8c2a2c6e3eadf5 | [
"MIT"
] | null | null | null | import random
from urllib.request import urlopen
import sys
WORD_URL="http://learncodethehardway.org/words.txt"
WORDS=[]
PHRASES={"class %%%(%%%):":
"Make a class named %%% that is-a %%%.",
"class %%%(object):\n\tdef _init_(self,***)":
"class %%% has-a _init_that takes self and *** params.",
... | 30.811321 | 71 | 0.637477 | import random
from urllib.request import urlopen
import sys
WORD_URL="http://learncodethehardway.org/words.txt"
WORDS=[]
PHRASES={"class %%%(%%%):":
"Make a class named %%% that is-a %%%.",
"class %%%(object):\n\tdef _init_(self,***)":
"class %%% has-a _init_that takes self and *** params.",
... | false | true |
f70953a63bbc0820445c238e63d7232ef154338a | 3,503 | py | Python | python/phonenumbers/data/region_HR.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | 2 | 2019-03-30T02:12:54.000Z | 2021-03-08T18:59:40.000Z | python/phonenumbers/data/region_HR.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/data/region_HR.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | 1 | 2018-11-10T03:47:34.000Z | 2018-11-10T03:47:34.000Z | """Auto-generated file, do not edit by hand. HR metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_HR = PhoneMetadata(id='HR', country_code=385, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[1-7]\\d{5,8}|[89]\\d{6,11}', possible_n... | 113 | 171 | 0.68684 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_HR = PhoneMetadata(id='HR', country_code=385, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[1-7]\\d{5,8}|[89]\\d{6,11}', possible_number_pattern='\\d{6,12}'),
fixed_line=PhoneNumberDesc(n... | true | true |
f7095508ece920b6fcd73d161319d0dad95e7721 | 3,451 | py | Python | misago/misago/legal/admin/views.py | vascoalramos/misago-deployment | 20226072138403108046c0afad9d99eb4163cedc | [
"MIT"
] | 2 | 2021-03-06T21:06:13.000Z | 2021-03-09T15:05:12.000Z | misago/misago/legal/admin/views.py | vascoalramos/misago-deployment | 20226072138403108046c0afad9d99eb4163cedc | [
"MIT"
] | null | null | null | misago/misago/legal/admin/views.py | vascoalramos/misago-deployment | 20226072138403108046c0afad9d99eb4163cedc | [
"MIT"
] | null | null | null | from django.contrib import messages
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from ...admin.views import generic
from ..models import Agreement
from .forms import AgreementForm, FilterAgreementsForm
from .utils import disable_agreement, set_agreement_as_active
class Agr... | 33.833333 | 88 | 0.676615 | from django.contrib import messages
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from ...admin.views import generic
from ..models import Agreement
from .forms import AgreementForm, FilterAgreementsForm
from .utils import disable_agreement, set_agreement_as_active
class Agr... | true | true |
f70955228f7c65d8e4a1e24999a745383cb9b48b | 397 | py | Python | apiwrapper/wsgi.py | drinkingjava/coingeckoapiwrapper | e95fcc3a80504f60aada4875f896ed5195ab351d | [
"MIT"
] | null | null | null | apiwrapper/wsgi.py | drinkingjava/coingeckoapiwrapper | e95fcc3a80504f60aada4875f896ed5195ab351d | [
"MIT"
] | null | null | null | apiwrapper/wsgi.py | drinkingjava/coingeckoapiwrapper | e95fcc3a80504f60aada4875f896ed5195ab351d | [
"MIT"
] | null | null | null | """
WSGI config for apiwrapper project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... | 23.352941 | 78 | 0.788413 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'apiwrapper.settings')
application = get_wsgi_application()
| true | true |
f709555143c36af3622b8322e5e065810a378a8a | 132 | py | Python | profiles_api/urls.py | karthiksar15/UdemyPython1 | d8b96935629f22df76c41ff6cd7a91b3c99b2b19 | [
"MIT"
] | null | null | null | profiles_api/urls.py | karthiksar15/UdemyPython1 | d8b96935629f22df76c41ff6cd7a91b3c99b2b19 | [
"MIT"
] | null | null | null | profiles_api/urls.py | karthiksar15/UdemyPython1 | d8b96935629f22df76c41ff6cd7a91b3c99b2b19 | [
"MIT"
] | null | null | null | from django.urls import path
from profiles_api import views
urlpatterns =[
path('hello-view/',views.HelloApiView.as_view())
]
| 16.5 | 52 | 0.75 | from django.urls import path
from profiles_api import views
urlpatterns =[
path('hello-view/',views.HelloApiView.as_view())
]
| true | true |
f709560f12383812ac7749a0819306cdeb93570b | 2,529 | py | Python | sdks/python/apache_beam/io/external/generate_sequence.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 35 | 2016-09-22T22:53:14.000Z | 2020-02-13T15:12:21.000Z | sdks/python/apache_beam/io/external/generate_sequence.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 80 | 2020-01-16T09:55:09.000Z | 2020-10-03T13:43:07.000Z | sdks/python/apache_beam/io/external/generate_sequence.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 88 | 2016-11-27T02:16:11.000Z | 2020-02-28T05:10:26.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 us... | 37.191176 | 78 | 0.740214 |
from __future__ import absolute_import
from apache_beam.transforms.external import ExternalTransform
from apache_beam.transforms.external import ImplicitSchemaPayloadBuilder
class GenerateSequence(ExternalTransform):
URN = 'beam:external:java:generate_sequence:v1'
def __init__(
self,
start,
... | true | true |
f709562b3b66244cdea52b42ea35831e94e2b9a0 | 7,079 | py | Python | aiml50/source/setup_pipeline.py | nswitanek/ignite-learning-paths-training-aiml | 018968f413f6c1aa11230c802f785fdaea54e480 | [
"CC-BY-4.0",
"MIT"
] | 203 | 2019-10-07T10:44:09.000Z | 2021-11-08T09:21:17.000Z | aiml50/source/setup_pipeline.py | nswitanek/ignite-learning-paths-training-aiml | 018968f413f6c1aa11230c802f785fdaea54e480 | [
"CC-BY-4.0",
"MIT"
] | 53 | 2019-10-08T15:15:04.000Z | 2020-11-23T16:29:39.000Z | aiml50/source/setup_pipeline.py | nswitanek/ignite-learning-paths-training-aiml | 018968f413f6c1aa11230c802f785fdaea54e480 | [
"CC-BY-4.0",
"MIT"
] | 210 | 2019-10-04T14:41:49.000Z | 2021-11-04T23:05:22.000Z | import azureml
from azureml.core import VERSION
from azureml.core import Workspace, Experiment, Datastore, Environment
from azureml.core.runconfig import RunConfiguration
from azureml.data.datapath import DataPath, DataPathComputeBinding
from azureml.data.data_reference import DataReference
from azureml.core.compute im... | 32.925581 | 115 | 0.647973 | import azureml
from azureml.core import VERSION
from azureml.core import Workspace, Experiment, Datastore, Environment
from azureml.core.runconfig import RunConfiguration
from azureml.data.datapath import DataPath, DataPathComputeBinding
from azureml.data.data_reference import DataReference
from azureml.core.compute im... | true | true |
f709570944e58ff82295df04816197313a44f4f1 | 1,286 | py | Python | cnns/nnlib/robustness/pni/code/models/nomarlization_layer.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | 1 | 2018-03-25T13:19:46.000Z | 2018-03-25T13:19:46.000Z | cnns/nnlib/robustness/pni/code/models/nomarlization_layer.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | null | null | null | cnns/nnlib/robustness/pni/code/models/nomarlization_layer.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
class Normalize_layer(nn.Module):
def __init__(self, mean, std):
super(Normalize_layer, self).__init__()
self.mean = nn.Parameter(torch.Tensor(mean).unsqueeze(1).unsqueeze(1),
requires_grad=False)
self.std = nn.Parameter(... | 33.842105 | 78 | 0.618196 | import torch
import torch.nn as nn
class Normalize_layer(nn.Module):
def __init__(self, mean, std):
super(Normalize_layer, self).__init__()
self.mean = nn.Parameter(torch.Tensor(mean).unsqueeze(1).unsqueeze(1),
requires_grad=False)
self.std = nn.Parameter(... | true | true |
f709582419a8e95e38133c411de04161dcccc9b3 | 19,859 | py | Python | modeling/backbones/resnet.py | yihui-he2020/epipolar-transformers | 6824f4345b2998500fbacd0f4e30f67f8e3da7b8 | [
"MIT"
] | 360 | 2020-03-30T07:15:45.000Z | 2022-03-04T14:08:04.000Z | modeling/backbones/resnet.py | yihui-he2020/epipolar-transformers | 6824f4345b2998500fbacd0f4e30f67f8e3da7b8 | [
"MIT"
] | 30 | 2020-05-12T11:12:20.000Z | 2021-12-31T05:49:10.000Z | modeling/backbones/resnet.py | yihui-he2020/epipolar-transformers | 6824f4345b2998500fbacd0f4e30f67f8e3da7b8 | [
"MIT"
] | 38 | 2020-05-12T05:33:46.000Z | 2022-01-25T22:27:45.000Z | import logging
import os
import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
from modeling.layers.epipolar import Epipolar
from modeling import registry
from core import cfg
from .basic_batch import find_tensor_peak_batch
from utils.logger import setup_logger
from utils.model_serialization imp... | 38.190385 | 199 | 0.599376 | import logging
import os
import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
from modeling.layers.epipolar import Epipolar
from modeling import registry
from core import cfg
from .basic_batch import find_tensor_peak_batch
from utils.logger import setup_logger
from utils.model_serialization imp... | true | true |
f7095a4b8f156351c6d348572d6e6f9a2c1cc9f1 | 1,173 | py | Python | st2client/st2client/models/keyvalue.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | null | null | null | st2client/st2client/models/keyvalue.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | 15 | 2021-02-11T22:58:54.000Z | 2021-08-06T18:03:47.000Z | st2client/st2client/models/keyvalue.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | 1 | 2021-07-10T15:02:29.000Z | 2021-07-10T15:02:29.000Z | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | 28.609756 | 92 | 0.729753 |
from __future__ import absolute_import
import logging
from st2client.models import core
LOG = logging.getLogger(__name__)
class KeyValuePair(core.Resource):
_alias = 'Key'
_display_name = 'Key Value Pair'
_plural = 'Keys'
_plural_display_name = 'Key Value Pairs'
_repr_attributes = ['name', 'v... | true | true |
f7095a719021448b51dcc63041132d4d9b8b1f68 | 10,043 | py | Python | didipack/latex_table.py | AntoineDidisheim/didipack | 9c9266bf248cae79e6ffddd98b7e573108abaa57 | [
"MIT"
] | null | null | null | didipack/latex_table.py | AntoineDidisheim/didipack | 9c9266bf248cae79e6ffddd98b7e573108abaa57 | [
"MIT"
] | null | null | null | didipack/latex_table.py | AntoineDidisheim/didipack | 9c9266bf248cae79e6ffddd98b7e573108abaa57 | [
"MIT"
] | 1 | 2021-02-08T09:26:04.000Z | 2021-02-08T09:26:04.000Z | import pandas as pd
import numpy as np
import statsmodels.api as sm
from enum import Enum
class ParValue(Enum):
TSTAT = 1
PVALUE = 2
STD = 3
class OneReg:
def __init__(self, reg, show_list=[], hide_list=[], blocks=[], bottom_blocks=[]):
self.reg = reg
if show_list == []:
se... | 34.393836 | 148 | 0.502738 | import pandas as pd
import numpy as np
import statsmodels.api as sm
from enum import Enum
class ParValue(Enum):
TSTAT = 1
PVALUE = 2
STD = 3
class OneReg:
def __init__(self, reg, show_list=[], hide_list=[], blocks=[], bottom_blocks=[]):
self.reg = reg
if show_list == []:
se... | true | true |
f7095a92645eb428a3155a581060c078485a7603 | 13,318 | py | Python | src/stim/stabilizers/pauli_string_pybind_test.py | noajshu/Stim | 503de420b1e56e90d7f44337ead1065a2ae26740 | [
"Apache-2.0"
] | 99 | 2021-03-03T19:03:25.000Z | 2022-03-22T11:39:08.000Z | src/stim/stabilizers/pauli_string_pybind_test.py | noajshu/Stim | 503de420b1e56e90d7f44337ead1065a2ae26740 | [
"Apache-2.0"
] | 95 | 2021-03-04T00:11:30.000Z | 2022-03-30T08:53:44.000Z | src/stim/stabilizers/pauli_string_pybind_test.py | noajshu/Stim | 503de420b1e56e90d7f44337ead1065a2ae26740 | [
"Apache-2.0"
] | 20 | 2021-03-09T14:10:13.000Z | 2022-03-15T04:40:12.000Z | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 28.037895 | 92 | 0.570431 |
import stim
import pytest
def test_identity():
p = stim.PauliString(3)
assert len(p) == 3
assert p[0] == p[1] == p[2] == 0
assert p.sign == +1
def test_from_str():
p = stim.PauliString("-_XYZ_ZYX")
assert len(p) == 8
assert p[0] == 0
assert p[1] == 1
assert p[2] == 2
assert ... | true | true |
f7095b8e4b08b57406f35839c522b08a768a6216 | 1,113 | py | Python | src/sumo_controller_node.py | ps-thunderatz/sumo_controller | 635219bbb9841ed83a391be3142fb87efd22a461 | [
"MIT"
] | null | null | null | src/sumo_controller_node.py | ps-thunderatz/sumo_controller | 635219bbb9841ed83a391be3142fb87efd22a461 | [
"MIT"
] | 7 | 2021-08-28T18:54:58.000Z | 2021-09-06T03:01:06.000Z | src/sumo_controller_node.py | ps-thunderatz/sumo_controller | 635219bbb9841ed83a391be3142fb87efd22a461 | [
"MIT"
] | 1 | 2021-09-05T18:59:05.000Z | 2021-09-05T18:59:05.000Z | #!/usr/bin/env python3
"""Node para controlar um robô de sumô
File
-------
sumo_controller/src/sumo_controller_node.py
Authors
-------
ThundeRatz Team <comp@thunderatz.org>
"""
import rospy
from std_msgs.msg import Float64
CONTROL_RATE = 60 # Hz
def main():
""" Lógica principal do node de controle
""... | 24.195652 | 91 | 0.680144 |
import rospy
from std_msgs.msg import Float64
CONTROL_RATE = 60
def main():
rospy.init_node("sumo_controller", disable_signals=True, anonymous=True)
rospy.loginfo(f"Node de controle iniciado {rospy.get_time()}")
rate = rospy.Rate(CONTROL_RATE)
while not rospy.is_shutdown():
... | true | true |
f7095bec43a635319555dc50a6ab8fae0442f341 | 9,403 | py | Python | tests/tools/commands/test_venv.py | Eric-Arellano/pex | 49955249ec3a8dfa8da5fd7da6a06b9666ae73c7 | [
"Apache-2.0"
] | null | null | null | tests/tools/commands/test_venv.py | Eric-Arellano/pex | 49955249ec3a8dfa8da5fd7da6a06b9666ae73c7 | [
"Apache-2.0"
] | null | null | null | tests/tools/commands/test_venv.py | Eric-Arellano/pex | 49955249ec3a8dfa8da5fd7da6a06b9666ae73c7 | [
"Apache-2.0"
] | 1 | 2021-03-08T21:42:57.000Z | 2021-03-08T21:42:57.000Z | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
import os
import subprocess
import tempfile
from subprocess import CalledProcessError
from textwrap import dedent
import pytest
from pex.common im... | 32.536332 | 98 | 0.622461 |
from __future__ import absolute_import
import os
import subprocess
import tempfile
from subprocess import CalledProcessError
from textwrap import dedent
import pytest
from pex.common import temporary_dir, touch
from pex.executor import Executor
from pex.testing import run_pex_command
from pex.tools.commands.virtual... | true | true |
f7095d1db7c3f81dc0dfa863c114fdc12fc2c216 | 2,964 | py | Python | test_scripts/main_cvxpy_simple.py | forgi86/pyMPC | 291db149554767a035fcb01df3fed7a6b3fe60e4 | [
"MIT"
] | 84 | 2019-05-28T09:27:37.000Z | 2022-03-31T08:38:23.000Z | test_scripts/main_cvxpy_simple.py | passion4energy/pyMPC | 4b004ba707dab49cd36d96a3575b8593c870a904 | [
"MIT"
] | 2 | 2020-04-17T00:03:27.000Z | 2021-01-30T11:35:58.000Z | test_scripts/main_cvxpy_simple.py | passion4energy/pyMPC | 4b004ba707dab49cd36d96a3575b8593c870a904 | [
"MIT"
] | 20 | 2019-10-13T13:50:16.000Z | 2022-03-31T08:38:25.000Z | from cvxpy import Variable, Parameter, Minimize, Problem, OSQP, quad_form
import numpy as np
import scipy as sp
import scipy.sparse as sparse
import time
if __name__ == "__main__":
# Discrete time model of a quadcopter
Ts = 0.2
M = 2.0
Ad = sparse.csc_matrix([
[1.0, Ts],
[0, 1.0]
... | 28.5 | 90 | 0.567476 | from cvxpy import Variable, Parameter, Minimize, Problem, OSQP, quad_form
import numpy as np
import scipy as sp
import scipy.sparse as sparse
import time
if __name__ == "__main__":
Ts = 0.2
M = 2.0
Ad = sparse.csc_matrix([
[1.0, Ts],
[0, 1.0]
])
Bd = sparse.csc_matrix([
... | true | true |
f7095e1387882767355bd3fa0991e66b2f0792c1 | 433 | py | Python | INBa/2014/MorenkoAA/MorenkoAA_1_14.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2014/MorenkoAA/MorenkoAA_1_14.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2014/MorenkoAA/MorenkoAA_1_14.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 1, Вариант 14
# Напишите программу, которая будет сообщать род деятельности и псевдоним под которым скрывается Мари Фрасуа Аруэ. После вывода информации программа должна дожидаться пока пользователь нажмет Enter для выхода.
# Моренко А.А.
# 07.03.2016
print("Мари Франсуа Аруэ, – великий французский п... | 54.125 | 210 | 0.78291 |
print("Мари Франсуа Аруэ, – великий французский писатель, поэт, драматург, философ-просветитель, более известный как Вольтер.")
Input("Нажмите Enter для выхода") | false | true |
f7095f4389a092c609358f7f82ea89c7b96159a9 | 11,890 | py | Python | src/ppscore/calculation.py | SuryaThiru/ppscore | 59df800e32d4ef5fda4be2bdf4b3235db2a39fee | [
"MIT"
] | null | null | null | src/ppscore/calculation.py | SuryaThiru/ppscore | 59df800e32d4ef5fda4be2bdf4b3235db2a39fee | [
"MIT"
] | null | null | null | src/ppscore/calculation.py | SuryaThiru/ppscore | 59df800e32d4ef5fda4be2bdf4b3235db2a39fee | [
"MIT"
] | null | null | null | from sklearn import tree
from sklearn import preprocessing
from sklearn.model_selection import cross_val_score
from sklearn.metrics import mean_absolute_error, f1_score
import pandas as pd
from pandas.api.types import (
is_numeric_dtype,
is_bool_dtype,
is_categorical_dtype,
is_string_dtype,
is_date... | 34.970588 | 306 | 0.655341 | from sklearn import tree
from sklearn import preprocessing
from sklearn.model_selection import cross_val_score
from sklearn.metrics import mean_absolute_error, f1_score
import pandas as pd
from pandas.api.types import (
is_numeric_dtype,
is_bool_dtype,
is_categorical_dtype,
is_string_dtype,
is_date... | true | true |
f7095f7c93a14717410ae3c0c3514e781f186551 | 832 | py | Python | direct/cli/utils.py | NKI-AI/direct | 7c9d59345b68ea70bc20a5cea2c895c6059f8e46 | [
"Apache-2.0"
] | 57 | 2021-12-21T23:11:46.000Z | 2022-03-26T23:25:36.000Z | direct/cli/utils.py | NKI-AI/direct | 7c9d59345b68ea70bc20a5cea2c895c6059f8e46 | [
"Apache-2.0"
] | 23 | 2021-12-22T15:02:20.000Z | 2022-03-29T21:12:37.000Z | direct/cli/utils.py | NKI-AI/direct | 7c9d59345b68ea70bc20a5cea2c895c6059f8e46 | [
"Apache-2.0"
] | 5 | 2021-12-22T17:15:28.000Z | 2022-03-03T02:44:12.000Z | # coding=utf-8
# Copyright (c) DIRECT Contributors
import argparse
import pathlib
import sys
from direct.types import FileOrUrl, PathOrString
from direct.utils.io import check_is_valid_url
def is_file(path):
path = pathlib.Path(path)
if path.is_file():
return path
raise argparse.ArgumentTypeErro... | 25.212121 | 116 | 0.704327 |
import argparse
import pathlib
import sys
from direct.types import FileOrUrl, PathOrString
from direct.utils.io import check_is_valid_url
def is_file(path):
path = pathlib.Path(path)
if path.is_file():
return path
raise argparse.ArgumentTypeError(f"{path} is not a valid file or url.")
def file... | true | true |
f7095fdd9792bebf1514154b53900ed899f43e29 | 303 | py | Python | Eshop/urls.py | deepchatterjeevns/Green-veggies-ECommerce-App | 142e8f9cb6766b99c0f8212ca77dc9bec41a9a83 | [
"MIT"
] | null | null | null | Eshop/urls.py | deepchatterjeevns/Green-veggies-ECommerce-App | 142e8f9cb6766b99c0f8212ca77dc9bec41a9a83 | [
"MIT"
] | null | null | null | Eshop/urls.py | deepchatterjeevns/Green-veggies-ECommerce-App | 142e8f9cb6766b99c0f8212ca77dc9bec41a9a83 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('store.urls'))
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
| 30.3 | 65 | 0.759076 | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('store.urls'))
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
| true | true |
f70960b00381015a48deaf6009d765c36d4c15c3 | 10,878 | py | Python | register.py | joakimlindblad/py_alpha_amd_release | 6a95286753c48e9f0c882d650158b15b58bcdd46 | [
"MIT"
] | null | null | null | register.py | joakimlindblad/py_alpha_amd_release | 6a95286753c48e9f0c882d650158b15b58bcdd46 | [
"MIT"
] | null | null | null | register.py | joakimlindblad/py_alpha_amd_release | 6a95286753c48e9f0c882d650158b15b58bcdd46 | [
"MIT"
] | null | null | null |
#
# Py-Alpha-AMD Registration Framework
# Author: Johan Ofverstedt
# Reference: Fast and Robust Symmetric Image Registration Based on Distances Combining Intensity and Spatial Information
#
# Copyright 2019 Johan Ofverstedt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this softwa... | 38.574468 | 206 | 0.668505 |
import numpy as np
import scipy as sp
import scipy.misc
from transforms import CompositeTransform
from transforms import AffineTransform
from transforms import Rigid2DTransform
from transforms import Rotate2DTransform
from transforms import TranslationTransform
from transforms import ScalingTransform
from distance... | true | true |
f70964bda74141f4f7530508848019e326ef048c | 99 | py | Python | fedml_api/data_preprocessing/stackoverflow_lr/__init__.py | GabriJP/FedML | 9ccf52baddc065bf9cf3ca8ae2eeaadbc338e988 | [
"Apache-2.0"
] | null | null | null | fedml_api/data_preprocessing/stackoverflow_lr/__init__.py | GabriJP/FedML | 9ccf52baddc065bf9cf3ca8ae2eeaadbc338e988 | [
"Apache-2.0"
] | null | null | null | fedml_api/data_preprocessing/stackoverflow_lr/__init__.py | GabriJP/FedML | 9ccf52baddc065bf9cf3ca8ae2eeaadbc338e988 | [
"Apache-2.0"
] | null | null | null | from .data_loader import StackOverflowLRDataLoader
__all__ = [
'StackOverflowLRDataLoader',
]
| 16.5 | 50 | 0.787879 | from .data_loader import StackOverflowLRDataLoader
__all__ = [
'StackOverflowLRDataLoader',
]
| true | true |
f70964db97d98144a8ce1f0e75a35480642ce6b9 | 1,273 | py | Python | discretisedfield/ovf2vtk.py | minrk/discretisedfield | 251584f8d976a7fafdff5402d16327489407c4dd | [
"BSD-3-Clause"
] | null | null | null | discretisedfield/ovf2vtk.py | minrk/discretisedfield | 251584f8d976a7fafdff5402d16327489407c4dd | [
"BSD-3-Clause"
] | null | null | null | discretisedfield/ovf2vtk.py | minrk/discretisedfield | 251584f8d976a7fafdff5402d16327489407c4dd | [
"BSD-3-Clause"
] | null | null | null | import argparse
import discretisedfield as df
def convert_files(input_files, output_files):
for input_file, output_file in zip(input_files, output_files):
field = df.Field.fromfile(input_file)
field.write(output_file)
def main():
parser = argparse.ArgumentParser(
prog='ovf2vtk',
... | 31.825 | 76 | 0.600157 | import argparse
import discretisedfield as df
def convert_files(input_files, output_files):
for input_file, output_file in zip(input_files, output_files):
field = df.Field.fromfile(input_file)
field.write(output_file)
def main():
parser = argparse.ArgumentParser(
prog='ovf2vtk',
... | true | true |
f70965108055debeb1faafd0a789bccc53cc61ee | 3,586 | py | Python | wallstreet_cli/main.py | kuuurt/wallstreet_cli | ce4f48b23c77a2955842685d9688fee6f45ba64f | [
"MIT"
] | null | null | null | wallstreet_cli/main.py | kuuurt/wallstreet_cli | ce4f48b23c77a2955842685d9688fee6f45ba64f | [
"MIT"
] | null | null | null | wallstreet_cli/main.py | kuuurt/wallstreet_cli | ce4f48b23c77a2955842685d9688fee6f45ba64f | [
"MIT"
] | null | null | null | import os
import argparse
# import json
from wallstreet import Stock
from wallstreet_cli import xetra
from forex_python.converter import CurrencyRates
LOCAL_DB_PATH = os.path.join(os.path.dirname(__file__), "data", "db.txt")
def _currency_conversion(source_v: float, source_currency: str, target_currency: str):
... | 32.017857 | 91 | 0.687395 | import os
import argparse
from wallstreet import Stock
from wallstreet_cli import xetra
from forex_python.converter import CurrencyRates
LOCAL_DB_PATH = os.path.join(os.path.dirname(__file__), "data", "db.txt")
def _currency_conversion(source_v: float, source_currency: str, target_currency: str):
c = CurrencyRa... | true | true |
f7096668b0d05bfcb253d440a0e8ab2c6d1bcb9f | 15,440 | py | Python | torch_ecg/models/cnn/multi_scopic.py | DeepPSP/torch_ecg | 6db5ffb063d0e8fb4ce97029a0d184a658f43a37 | [
"MIT"
] | 9 | 2021-06-26T03:00:55.000Z | 2022-03-03T13:43:00.000Z | torch_ecg/models/cnn/multi_scopic.py | DeepPSP/torch_ecg | 6db5ffb063d0e8fb4ce97029a0d184a658f43a37 | [
"MIT"
] | 1 | 2021-10-01T09:29:30.000Z | 2021-10-02T03:41:55.000Z | torch_ecg/models/cnn/multi_scopic.py | DeepPSP/torch_ecg | 6db5ffb063d0e8fb4ce97029a0d184a658f43a37 | [
"MIT"
] | 2 | 2021-05-25T14:52:03.000Z | 2021-12-29T15:09:08.000Z | """
The core part of the SOTA model of CPSC2019,
branched, and has different scope (in terms of dilation) in each branch
"""
from copy import deepcopy
from itertools import repeat
from collections import OrderedDict
from typing import Union, Optional, Sequence, NoReturn
import numpy as np
np.set_printoptions(precision... | 38.217822 | 147 | 0.592034 | from copy import deepcopy
from itertools import repeat
from collections import OrderedDict
from typing import Union, Optional, Sequence, NoReturn
import numpy as np
np.set_printoptions(precision=5, suppress=True)
import torch
from torch import nn
from torch import Tensor
from ...cfg import CFG, DEFAULTS
from ...utils... | true | true |
f70966e3c9f9dccb779b1817d27df03b62c5153e | 5,073 | py | Python | tensorflow/contrib/distributions/python/kernel_tests/distribution_test.py | My-Technical-Architect/tensorflow | 35cf4653e6fe15953e2e565afc5a0fd2ab4d5290 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/distributions/python/kernel_tests/distribution_test.py | My-Technical-Architect/tensorflow | 35cf4653e6fe15953e2e565afc5a0fd2ab4d5290 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/distributions/python/kernel_tests/distribution_test.py | My-Technical-Architect/tensorflow | 35cf4653e6fe15953e2e565afc5a0fd2ab4d5290 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.91129 | 80 | 0.650897 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.framework import tensor_util
dists = tf.contrib.distributions
class DistributionTest(tf.test.TestCase):
def testParamShapesAndFromParams(self):
classes =... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.