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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3f3429032667dca3939a237e76121898898372 | 13,890 | py | Python | David and Pooja/++Validating Linked Mods/Python-3.0/Lib/binhex.py | LinkedModernismProject/web_code | 4cf6bf53d5c3249e52a75f0a3f57d106e31daf9e | [
"Apache-2.0"
] | 1 | 2015-05-21T23:47:54.000Z | 2015-05-21T23:47:54.000Z | front-end/testsuite-python-lib/Python-3.1/Lib/binhex.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2015-10-29T20:51:31.000Z | 2015-10-29T20:51:31.000Z | front-end/testsuite-python-lib/Python-3.1/Lib/binhex.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2019-04-11T11:27:01.000Z | 2019-04-11T11:27:01.000Z | """Macintosh binhex compression/decompression.
easy interface:
binhex(inputfilename, outputfilename)
hexbin(inputfilename, outputfilename)
"""
#
# Jack Jansen, CWI, August 1995.
#
# The module is supposed to be as compatible as possible. Especially the
# easy interface should work "as expected" on any platform.
# XXX... | 28.9375 | 79 | 0.54838 |
# input. The resulting code (xx 90 90) would appear to be interpreted as an
# escaped *value* of 0x90. All coders I've seen appear to ignore this nicety...
import io
import os
import sys
import struct
import binascii
__all__ = ["binhex","hexbin","Error"]
class Error(Exception):
pass
[_DID_HEADER,... | true | true |
1c3f34b102d2f0b88d8546b3a531125fc9dd1649 | 485 | py | Python | src/schemas/service_schema.py | Nardri/rbac-service | c5cf6baf60e95a7790156c85e37c76c697efd585 | [
"MIT"
] | null | null | null | src/schemas/service_schema.py | Nardri/rbac-service | c5cf6baf60e95a7790156c85e37c76c697efd585 | [
"MIT"
] | null | null | null | src/schemas/service_schema.py | Nardri/rbac-service | c5cf6baf60e95a7790156c85e37c76c697efd585 | [
"MIT"
] | null | null | null | """Service schema module"""
from marshmallow import fields, validate, post_load
from src.schemas import BaseSchema
class ServiceSchema(BaseSchema):
"""Schema class"""
name = fields.String(required=True,
validate=[validate.Length(min=3, max=100)])
@post_load
def append_servi... | 25.526316 | 68 | 0.643299 |
from marshmallow import fields, validate, post_load
from src.schemas import BaseSchema
class ServiceSchema(BaseSchema):
name = fields.String(required=True,
validate=[validate.Length(min=3, max=100)])
@post_load
def append_service_to_name(self, data, **kwargs):
data['na... | true | true |
1c3f34f9e49804db348754d24fea1e5a877cf275 | 315 | py | Python | venafi_vcert_gitlab_integration/version_command.py | fullstaq-labs/venafi-vcert-gitlab-integration | bb4549e1d83a4afe177665f04ca778e7c4f59d75 | [
"Apache-2.0"
] | null | null | null | venafi_vcert_gitlab_integration/version_command.py | fullstaq-labs/venafi-vcert-gitlab-integration | bb4549e1d83a4afe177665f04ca778e7c4f59d75 | [
"Apache-2.0"
] | 3 | 2021-06-07T08:08:07.000Z | 2021-08-02T09:25:56.000Z | venafi_vcert_gitlab_integration/version_command.py | fullstaq-labs/venafi-vcert-gitlab-integration | bb4549e1d83a4afe177665f04ca778e7c4f59d75 | [
"Apache-2.0"
] | null | null | null | import os
module_dir = os.path.abspath(os.path.join(os.path.dirname(__file__)))
def read_product_version():
with open(os.path.join(module_dir, 'version.txt'), 'r', encoding='UTF-8') as f:
return f.read().strip()
def main():
print(read_product_version())
if __name__ == '__main__':
main()
| 18.529412 | 83 | 0.663492 | import os
module_dir = os.path.abspath(os.path.join(os.path.dirname(__file__)))
def read_product_version():
with open(os.path.join(module_dir, 'version.txt'), 'r', encoding='UTF-8') as f:
return f.read().strip()
def main():
print(read_product_version())
if __name__ == '__main__':
main()
| true | true |
1c3f35e8ed1199cf7a5df4b9f29f45e0ee1e147e | 852 | py | Python | CoinCounter.py | KRHS-GameProgramming-2018/The-Adventures-of-Spaceman | 030ce5006344ffab595309949ad5eef42d6f4aa9 | [
"BSD-2-Clause"
] | null | null | null | CoinCounter.py | KRHS-GameProgramming-2018/The-Adventures-of-Spaceman | 030ce5006344ffab595309949ad5eef42d6f4aa9 | [
"BSD-2-Clause"
] | 11 | 2019-01-28T13:09:29.000Z | 2019-03-12T12:19:38.000Z | CoinCounter.py | KRHS-GameProgramming-2018/The-Adventures-of-Spaceman | 030ce5006344ffab595309949ad5eef42d6f4aa9 | [
"BSD-2-Clause"
] | null | null | null | import pygame, sys, math
#HealthBar and Power Ups
class CoinCounter(pygame.sprite.Sprite):
def __init__(self, coins=0, pos = [0,0]):
pygame.sprite.Sprite.__init__(self, self.containers)
self.coin = coins
self.font = pygame.font.Font("8-Bit Madness.ttf", 48)
# ~ self... | 31.555556 | 74 | 0.585681 | import pygame, sys, math
class CoinCounter(pygame.sprite.Sprite):
def __init__(self, coins=0, pos = [0,0]):
pygame.sprite.Sprite.__init__(self, self.containers)
self.coin = coins
self.font = pygame.font.Font("8-Bit Madness.ttf", 48)
self.image = se... | true | true |
1c3f37b0d6abe80e9abf5047bd200068d3915b3b | 280 | py | Python | camper/pages/templatetags/pages_tags.py | drinks/camper | 82d9f1342886d91bf6787c1bcdb1a7cb62e53ca3 | [
"BSD-3-Clause"
] | null | null | null | camper/pages/templatetags/pages_tags.py | drinks/camper | 82d9f1342886d91bf6787c1bcdb1a7cb62e53ca3 | [
"BSD-3-Clause"
] | null | null | null | camper/pages/templatetags/pages_tags.py | drinks/camper | 82d9f1342886d91bf6787c1bcdb1a7cb62e53ca3 | [
"BSD-3-Clause"
] | null | null | null | from django import template
from camper.pages.models import Chunk
register = template.Library()
@register.simple_tag(name='chunk')
def do_chunk(slug):
try:
c = Chunk.objects.get(slug=slug)
return c.content
except Chunk.DoesNotExist:
return ''
| 17.5 | 40 | 0.682143 | from django import template
from camper.pages.models import Chunk
register = template.Library()
@register.simple_tag(name='chunk')
def do_chunk(slug):
try:
c = Chunk.objects.get(slug=slug)
return c.content
except Chunk.DoesNotExist:
return ''
| true | true |
1c3f38cdc80a2becaf809b2b5084b77fa89579c6 | 682 | py | Python | web/api/app.py | kosyachniy/dev | 39bb5c5ee10780bfcd8a59cf59cfb1a348ac52a4 | [
"Apache-2.0"
] | 13 | 2018-12-17T23:30:54.000Z | 2021-12-29T14:31:43.000Z | web/api/app.py | kosyachniy/dev | 39bb5c5ee10780bfcd8a59cf59cfb1a348ac52a4 | [
"Apache-2.0"
] | 36 | 2018-06-07T21:34:13.000Z | 2022-03-13T21:01:43.000Z | web/api/app.py | kosyachniy/dev | 39bb5c5ee10780bfcd8a59cf59cfb1a348ac52a4 | [
"Apache-2.0"
] | 2 | 2021-01-03T11:47:20.000Z | 2021-12-29T14:31:49.000Z | from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
class Input(BaseModel):
method: str
params: dict = {}
locale: str = 'en'
token: str = None
app = FastAPI(title='Web app API')
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
... | 21.3125 | 66 | 0.680352 | from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
class Input(BaseModel):
method: str
params: dict = {}
locale: str = 'en'
token: str = None
app = FastAPI(title='Web app API')
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
... | true | true |
1c3f39799557f9a44493355c1da9e2d7a9f96e9d | 50,056 | py | Python | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | null | null | null | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | null | null | null | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | null | null | null | """Common configure functions for interface"""
# Python
import logging
# Unicon
from unicon.core.errors import SubCommandFailure
# Steps
from pyats.aetest.steps import Steps
# Genie
from genie.conf.base import Interface
from genie.libs.conf.base import IPv4Address, IPv6Address
from genie.libs.conf.interface import ... | 29.306792 | 114 | 0.567484 |
import logging
from unicon.core.errors import SubCommandFailure
from pyats.aetest.steps import Steps
from genie.conf.base import Interface
from genie.libs.conf.base import IPv4Address, IPv6Address
from genie.libs.conf.interface import IPv4Addr, IPv6Addr
from genie.harness.utils import connect_device
from geni... | true | true |
1c3f39a368018d62b2c631d5a8d2532741dedc90 | 6,827 | py | Python | checkTasks.py | Paola351/recurring-tasks | d05abc8d4029eee3638c18a468b607f9c548c6f6 | [
"MIT"
] | null | null | null | checkTasks.py | Paola351/recurring-tasks | d05abc8d4029eee3638c18a468b607f9c548c6f6 | [
"MIT"
] | null | null | null | checkTasks.py | Paola351/recurring-tasks | d05abc8d4029eee3638c18a468b607f9c548c6f6 | [
"MIT"
] | null | null | null | import configparser, sendMail
from datetime import datetime
import logging
logging.basicConfig(level='DEBUG', filename='logs/app.log', filemode='a', format='%(name)s - %(levelname)s - %(asctime)s - %(message)s')
taskTypeList = ["daily", "weekly", "monthly", "weekdayofmonth", "yearly", "free"]
daysOfTheWeek = ["Monday... | 44.045161 | 136 | 0.56174 | import configparser, sendMail
from datetime import datetime
import logging
logging.basicConfig(level='DEBUG', filename='logs/app.log', filemode='a', format='%(name)s - %(levelname)s - %(asctime)s - %(message)s')
taskTypeList = ["daily", "weekly", "monthly", "weekdayofmonth", "yearly", "free"]
daysOfTheWeek = ["Monday... | true | true |
1c3f39cffcbd5fc2bd8e3c59a4f930fe745144cc | 2,179 | py | Python | Bot/sending_emails.py | DogsonPl/bot_for_messenger | 2d6664b52b59696dc82efb3d361b7700ebb3960b | [
"MIT"
] | 19 | 2021-03-11T12:59:00.000Z | 2022-02-12T18:50:58.000Z | Bot/sending_emails.py | DogsonPl/bot_for_messenger | 2d6664b52b59696dc82efb3d361b7700ebb3960b | [
"MIT"
] | null | null | null | Bot/sending_emails.py | DogsonPl/bot_for_messenger | 2d6664b52b59696dc82efb3d361b7700ebb3960b | [
"MIT"
] | 4 | 2021-03-10T23:07:13.000Z | 2021-09-28T18:55:30.000Z | import random as rd
import asyncio
import aiosmtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from . import parse_config
async def get_confirmation_code():
confirmation_code = rd.randint(10000, 99999)
return confirmation_code
class SmptConnection:
def __init_... | 35.721311 | 120 | 0.662689 | import random as rd
import asyncio
import aiosmtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from . import parse_config
async def get_confirmation_code():
confirmation_code = rd.randint(10000, 99999)
return confirmation_code
class SmptConnection:
def __init_... | true | true |
1c3f39e71209012af52fd19efc149b2e9bb09f5e | 8,485 | py | Python | docs/conf.py | lalmeras/clickable | 6182f8a106c202a9bb1e6d7142e2b5b4734c13f3 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | lalmeras/clickable | 6182f8a106c202a9bb1e6d7142e2b5b4734c13f3 | [
"BSD-3-Clause"
] | 297 | 2017-09-29T23:51:42.000Z | 2021-08-31T09:27:17.000Z | docs/conf.py | lalmeras/clickable | 6182f8a106c202a9bb1e6d7142e2b5b4734c13f3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# clickable documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# a... | 30.742754 | 76 | 0.717384 |
import sys
import os
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
import clickable
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'c... | true | true |
1c3f3a76aba94a9ad074c4c60884e68d0eb42c07 | 1,148 | py | Python | setup.py | kttian/ifcc | 017827fb175713802d3128de4841cc4d54cc7598 | [
"Apache-2.0"
] | 43 | 2020-10-21T03:25:21.000Z | 2022-03-26T08:13:06.000Z | setup.py | kttian/ifcc | 017827fb175713802d3128de4841cc4d54cc7598 | [
"Apache-2.0"
] | 8 | 2020-12-04T15:06:45.000Z | 2022-03-28T12:18:14.000Z | setup.py | kttian/ifcc | 017827fb175713802d3128de4841cc4d54cc7598 | [
"Apache-2.0"
] | 10 | 2020-11-13T03:46:09.000Z | 2022-02-05T21:39:52.000Z | import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='ifcc',
version='0.2.0',
author='Yasuhide Miura',
author_email='ysmiura@stanford.edu',
description='The code of: Improving Factual Completeness and Consistency of Image-to-text Radiology R... | 26.697674 | 123 | 0.550523 | import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='ifcc',
version='0.2.0',
author='Yasuhide Miura',
author_email='ysmiura@stanford.edu',
description='The code of: Improving Factual Completeness and Consistency of Image-to-text Radiology R... | true | true |
1c3f3acd79d785a1aab6f01a36bd71f0c6d3cbac | 39 | py | Python | protocols/protocol_7_0/coverage.py | Lucioric2000/GelReportModels | 1704cdea3242d5b46c8b81ef46553ccae2799435 | [
"Apache-2.0"
] | null | null | null | protocols/protocol_7_0/coverage.py | Lucioric2000/GelReportModels | 1704cdea3242d5b46c8b81ef46553ccae2799435 | [
"Apache-2.0"
] | null | null | null | protocols/protocol_7_0/coverage.py | Lucioric2000/GelReportModels | 1704cdea3242d5b46c8b81ef46553ccae2799435 | [
"Apache-2.0"
] | null | null | null | from protocols.coverage_0_1_0 import *
| 19.5 | 38 | 0.846154 | from protocols.coverage_0_1_0 import *
| true | true |
1c3f3b07e8b2c3bb8e69f784a981b7d41aebc9f9 | 212 | py | Python | Symbol Patterns/symbolicpattern38.py | Daksh777/Python-PatternHouse | ab801631c2e1f5ed3cc12a26c959d41a5e51273d | [
"MIT"
] | 8 | 2021-03-20T11:26:35.000Z | 2022-01-05T02:39:15.000Z | Symbol Patterns/symbolicpattern38.py | Daksh777/Python-PatternHouse | ab801631c2e1f5ed3cc12a26c959d41a5e51273d | [
"MIT"
] | 851 | 2021-04-02T09:08:15.000Z | 2022-01-12T11:26:57.000Z | Symbol Patterns/symbolicpattern38.py | Daksh777/Python-PatternHouse | ab801631c2e1f5ed3cc12a26c959d41a5e51273d | [
"MIT"
] | 15 | 2021-04-13T06:10:17.000Z | 2022-01-08T05:07:21.000Z | print("Enter the no of rows: ")
n = int(input())
for i in range(0, n):
for j in range(0, i+1):
if j % 2 == 0:
print("#", end=" ")
else:
print("*", end=" ")
print()
| 21.2 | 31 | 0.410377 | print("Enter the no of rows: ")
n = int(input())
for i in range(0, n):
for j in range(0, i+1):
if j % 2 == 0:
print("#", end=" ")
else:
print("*", end=" ")
print()
| true | true |
1c3f3b3bcfad31e4d9aa1a8ba8c130cb3fca91f0 | 925 | py | Python | mainland/_main.py | moshez/mainland | 4aadf63d6e971518940828b1cc0b648ff5629bdd | [
"MIT"
] | null | null | null | mainland/_main.py | moshez/mainland | 4aadf63d6e971518940828b1cc0b648ff5629bdd | [
"MIT"
] | 1 | 2015-06-28T04:29:16.000Z | 2015-06-28T04:29:16.000Z | mainland/_main.py | moshez/mainland | 4aadf63d6e971518940828b1cc0b648ff5629bdd | [
"MIT"
] | null | null | null | # Copyright (c) Moshe Zadka
# See LICENSE for details.
import importlib
def main(argv, root, suffix=None, marker=None):
argv = list(argv)
argv.pop(0)
if not argv:
raise SystemExit('Need subcommand name')
moduleName = argv[0]
if not root.endswith('.'):
root += '.'
moduleName = ... | 25.694444 | 64 | 0.616216 |
import importlib
def main(argv, root, suffix=None, marker=None):
argv = list(argv)
argv.pop(0)
if not argv:
raise SystemExit('Need subcommand name')
moduleName = argv[0]
if not root.endswith('.'):
root += '.'
moduleName = root + moduleName
if marker is None:
mark... | true | true |
1c3f3cab650e18c49a607e9a58896887699da0e5 | 6,288 | py | Python | train.py | deep-spin/SIGMORPHON2019 | 60cf3b53be42e76238e7928405b2916cd9aed6c4 | [
"MIT"
] | 2 | 2019-07-30T06:50:21.000Z | 2020-02-05T17:42:06.000Z | train.py | deep-spin/SIGMORPHON2019 | 60cf3b53be42e76238e7928405b2916cd9aed6c4 | [
"MIT"
] | 1 | 2019-08-20T08:57:21.000Z | 2019-08-21T08:49:48.000Z | train.py | deep-spin/SIGMORPHON2019 | 60cf3b53be42e76238e7928405b2916cd9aed6c4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import configargparse
import onmt.opts as opts
import os
import random
from itertools import chain
import torch
import torchtext
# from torchtext.data.iterator import Iterator
from onmt.model_builder import build_model
from onmt.trainer import build_trainer
from onmt.utils.logging import init... | 33.625668 | 78 | 0.655057 |
import configargparse
import onmt.opts as opts
import os
import random
from itertools import chain
import torch
import torchtext
from onmt.model_builder import build_model
from onmt.trainer import build_trainer
from onmt.utils.logging import init_logger, logger
from onmt.utils.misc import use_gpu
class Ordered... | true | true |
1c3f3d09d01c34a2e0a05784c79668ab8345ab5d | 16,772 | py | Python | datacube/_version.py | Zac-HD/datacube-core | ebc2025b6fb9d22fb406cdf5f79eba6d144c57e3 | [
"Apache-2.0"
] | 27 | 2016-08-16T18:22:47.000Z | 2018-08-25T17:18:15.000Z | datacube/_version.py | cronosnull/agdc-v2 | 596923779d3650c47a6b43276b3369a5ec619158 | [
"Apache-2.0"
] | 103 | 2018-03-21T15:00:05.000Z | 2020-06-04T05:40:25.000Z | datacube/_version.py | cronosnull/agdc-v2 | 596923779d3650c47a6b43276b3369a5ec619158 | [
"Apache-2.0"
] | 27 | 2016-08-26T18:14:40.000Z | 2021-12-24T08:41:29.000Z |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | 34.439425 | 79 | 0.590866 |
import errno
import os
import re
import subprocess
import sys
def get_keywords():
git_refnames = "$Format:%d$"
git_full = "$Format:%H$"
keywords = {"refnames": git_refnames, "full": git_full}
return keywords
class VersioneerConfig:
def get_config():
c... | true | true |
1c3f3d27fb37722a95dadc0a104c89f03af4fc1c | 1,652 | py | Python | app/distribution/forms/settings.py | RinKiruko/MatHelp | 5178f83fdf46c92be1014e18e63d64f36e80082e | [
"MIT"
] | null | null | null | app/distribution/forms/settings.py | RinKiruko/MatHelp | 5178f83fdf46c92be1014e18e63d64f36e80082e | [
"MIT"
] | null | null | null | app/distribution/forms/settings.py | RinKiruko/MatHelp | 5178f83fdf46c92be1014e18e63d64f36e80082e | [
"MIT"
] | null | null | null | from django import forms
from django.db.models import QuerySet
from django.utils import timezone
from crud.models import StatementCategory, Statement
from general.forms import *
MONTH_CHOICES = (
(1, 'Январь'),
(2, 'Февраль'),
(3, 'Март'),
(4, 'Апрель'),
(5, 'Май'),
(6, 'Июнь'),
(7, 'Июль'... | 24.656716 | 91 | 0.591404 | from django import forms
from django.db.models import QuerySet
from django.utils import timezone
from crud.models import StatementCategory, Statement
from general.forms import *
MONTH_CHOICES = (
(1, 'Январь'),
(2, 'Февраль'),
(3, 'Март'),
(4, 'Апрель'),
(5, 'Май'),
(6, 'Июнь'),
(7, 'Июль'... | true | true |
1c3f3daf361120283f4d06efaa952302acb7fa00 | 16,093 | py | Python | tests/test_adt.py | deztructor/pycor | f77e3f197ddda276932af9d3a19e89a590971d3d | [
"MIT"
] | null | null | null | tests/test_adt.py | deztructor/pycor | f77e3f197ddda276932af9d3a19e89a590971d3d | [
"MIT"
] | null | null | null | tests/test_adt.py | deztructor/pycor | f77e3f197ddda276932af9d3a19e89a590971d3d | [
"MIT"
] | null | null | null | from collections import namedtuple
from enum import Enum
from functools import partial
import types
import pytest
from cor.adt.error import (
AccessError,
InvalidFieldError,
MissingFieldError,
RecordError,
)
from cor.adt.hook import (
HooksFactory,
field_invariant,
Target,
)
from cor.adt.r... | 26.956449 | 108 | 0.600199 | from collections import namedtuple
from enum import Enum
from functools import partial
import types
import pytest
from cor.adt.error import (
AccessError,
InvalidFieldError,
MissingFieldError,
RecordError,
)
from cor.adt.hook import (
HooksFactory,
field_invariant,
Target,
)
from cor.adt.r... | true | true |
1c3f3dba7e5615f38b36309c6c6af4695a82f1c3 | 222 | py | Python | python_class/mylist.py | wasit7/cs402 | 5a0f945eb7c9944edc0a423d5c37bc4ef867b950 | [
"MIT"
] | null | null | null | python_class/mylist.py | wasit7/cs402 | 5a0f945eb7c9944edc0a423d5c37bc4ef867b950 | [
"MIT"
] | null | null | null | python_class/mylist.py | wasit7/cs402 | 5a0f945eb7c9944edc0a423d5c37bc4ef867b950 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 19 11:03:23 2015
@author: Wasit
"""
mylist=[]
mylist.append(7)
mylist.append("my string")
mylist.append('my string again')
another_list=[1,2,3]
mylist.append(another_list) | 14.8 | 35 | 0.68018 |
mylist=[]
mylist.append(7)
mylist.append("my string")
mylist.append('my string again')
another_list=[1,2,3]
mylist.append(another_list) | true | true |
1c3f3eaad60aae87f0b648d03b91a17e4f0ba778 | 82,340 | py | Python | sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2019-08-23T21:14:00.000Z | 2021-09-07T18:32:34.000Z | sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | null | null | null | sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"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 ... | 51.591479 | 269 | 0.649964 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impor... | true | true |
1c3f3f189bcc82ea3ecf76fbf06a505daa6f205c | 72,425 | py | Python | webui/qfsstatus.py | chanwit/qfs | dc6ba65f42ba55ed7d47e8a0cbf025096304f5d1 | [
"Apache-2.0"
] | 1 | 2017-08-21T10:57:34.000Z | 2017-08-21T10:57:34.000Z | webui/qfsstatus.py | subrata4096/qfs-repair | dba4ef5b78ad4b1bd8ef6e8ff902471afbd704a2 | [
"Apache-2.0"
] | null | null | null | webui/qfsstatus.py | subrata4096/qfs-repair | dba4ef5b78ad4b1bd8ef6e8ff902471afbd704a2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# $Id$
#
# Copyright 2008-2012 Quantcast Corp.
#
# Author: Sriram Rao (Quantcast Corp.)
#
# This file is part of Kosmos File System (KFS).
#
# 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... | 36.032338 | 132 | 0.528077 |
import os,sys,os.path,getopt
import socket,threading,calendar,time
from datetime import datetime
import SimpleHTTPServer
import SocketServer
from cStringIO import StringIO
from ConfigParser import ConfigParser
import urllib
import platform
from chunks import ChunkThread, ChunkDataManager, HtmlP... | false | true |
1c3f406dfd935bf28aae35459dc00f6c4f609492 | 16,352 | bzl | Python | scala/scala_maven_import_external.bzl | SeaJaredCode/rules_scala | c291447cabd35fd051989cad000b6ec6490285fd | [
"Apache-2.0"
] | null | null | null | scala/scala_maven_import_external.bzl | SeaJaredCode/rules_scala | c291447cabd35fd051989cad000b6ec6490285fd | [
"Apache-2.0"
] | null | null | null | scala/scala_maven_import_external.bzl | SeaJaredCode/rules_scala | c291447cabd35fd051989cad000b6ec6490285fd | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Bazel 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 applicable la... | 37.248292 | 164 | 0.694777 |
_HEADER = "# DO NOT EDIT: generated by jvm_import_external()"
_PASS_PROPS = (
"neverlink",
"testonly_",
"visibility",
"exports",
"runtime_deps",
"deps",
"tags",
)
def _jvm_import_external(repository_ctx):
if (repository_ctx.attr.generated_linkable_rule_name and
not... | true | true |
1c3f40ba3671355bb84bec525b3ec2763f6c7c75 | 3,097 | py | Python | backend/backend/settings.py | RebornBeat/CodeEmerge | 81066b1be8690c4600e3c656d7da45f035ab2ad7 | [
"MIT"
] | null | null | null | backend/backend/settings.py | RebornBeat/CodeEmerge | 81066b1be8690c4600e3c656d7da45f035ab2ad7 | [
"MIT"
] | null | null | null | backend/backend/settings.py | RebornBeat/CodeEmerge | 81066b1be8690c4600e3c656d7da45f035ab2ad7 | [
"MIT"
] | null | null | null | """
Django settings for backend project.
Generated by 'django-admin startproject' using Django 3.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib... | 25.385246 | 91 | 0.693252 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'pzfu+ar#2)!-)(ug%hz)*_d@%e@g$%r!k)*doy$8imp&26!n$o'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'course.apps.CourseConfig',
'django.contrib.admin',
'django.contrib.auth',
... | true | true |
1c3f414f148b99f54adabdd14a531a20e819bfe9 | 863 | py | Python | ooobuild/dyn/configuration/default_provider.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/configuration/default_provider.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/configuration/default_provider.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 33.192308 | 83 | 0.763615 |
from ...lo.configuration.default_provider import DefaultProvider as DefaultProvider
__all__ = ['DefaultProvider']
| true | true |
1c3f421debe446f13f349bd6fae64340c34dcb36 | 1,677 | py | Python | setup.py | kikitrade/dubbo-python3 | c8f721d2b7e73909f283c7cdca3b5449892ca400 | [
"Apache-2.0"
] | null | null | null | setup.py | kikitrade/dubbo-python3 | c8f721d2b7e73909f283c7cdca3b5449892ca400 | [
"Apache-2.0"
] | null | null | null | setup.py | kikitrade/dubbo-python3 | c8f721d2b7e73909f283c7cdca3b5449892ca400 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
/*
* 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
... | 35.680851 | 75 | 0.670841 |
from setuptools import setup, find_packages
setup(
name='dubbo-python3',
version='1.0.3',
url='https://github.com/kikitrade/dubbo-python3',
author='holly',
author_email='hao.holly@gmail.com',
description='Python3 Dubbo Client.',
license='Apache License 2.0',
packages=find_packages(exc... | true | true |
1c3f422e6389aefe6aac0be4a15ed6fdbe434335 | 11,028 | py | Python | pygmt/src/project.py | Test-Organization-6/pygmt | 0aa04d79dfd5d1aeaec9e4b2e4b43850bd6c0299 | [
"BSD-3-Clause"
] | null | null | null | pygmt/src/project.py | Test-Organization-6/pygmt | 0aa04d79dfd5d1aeaec9e4b2e4b43850bd6c0299 | [
"BSD-3-Clause"
] | null | null | null | pygmt/src/project.py | Test-Organization-6/pygmt | 0aa04d79dfd5d1aeaec9e4b2e4b43850bd6c0299 | [
"BSD-3-Clause"
] | null | null | null | """
project - Project data onto lines or great circles, or generate tracks.
"""
import pandas as pd
from pygmt.clib import Session
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import (
GMTTempFile,
build_arg_string,
fmt_docstring,
kwargs_to_strings,
use_alias,
)
@fmt_docstring
@... | 43.247059 | 88 | 0.622416 | import pandas as pd
from pygmt.clib import Session
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import (
GMTTempFile,
build_arg_string,
fmt_docstring,
kwargs_to_strings,
use_alias,
)
@fmt_docstring
@use_alias(
A="azimuth",
C="center",
E="endpoint",
F="convention"... | true | true |
1c3f434c07380dbc6d20fcddd44cfbd2e197eca8 | 14,185 | py | Python | napari/_qt/dialogs/preferences_dialog.py | marlene09/napari | d3284b5df2efc0fad2664f954cbc52cca9daa105 | [
"BSD-3-Clause"
] | null | null | null | napari/_qt/dialogs/preferences_dialog.py | marlene09/napari | d3284b5df2efc0fad2664f954cbc52cca9daa105 | [
"BSD-3-Clause"
] | null | null | null | napari/_qt/dialogs/preferences_dialog.py | marlene09/napari | d3284b5df2efc0fad2664f954cbc52cca9daa105 | [
"BSD-3-Clause"
] | null | null | null | import json
from qtpy.QtCore import QSize, Signal
from qtpy.QtWidgets import (
QDialog,
QHBoxLayout,
QListWidget,
QPushButton,
QStackedWidget,
QVBoxLayout,
)
from ..._vendor.qt_json_builder.qt_jsonschema_form import WidgetBuilder
from ...utils.settings import get_settings
from ...utils.transla... | 34.513382 | 97 | 0.585407 | import json
from qtpy.QtCore import QSize, Signal
from qtpy.QtWidgets import (
QDialog,
QHBoxLayout,
QListWidget,
QPushButton,
QStackedWidget,
QVBoxLayout,
)
from ..._vendor.qt_json_builder.qt_jsonschema_form import WidgetBuilder
from ...utils.settings import get_settings
from ...utils.transla... | true | true |
1c3f43546d2c6e7b55e1780c060faf8bc8c3afc1 | 636 | py | Python | backend/manage.py | crowdbotics-apps/muddy-term-29546 | 6e530c79087dbd3657982886fc0fe77de21f4adc | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/muddy-term-29546 | 6e530c79087dbd3657982886fc0fe77de21f4adc | [
"FTL",
"AML",
"RSA-MD"
] | 42 | 2021-08-06T02:56:25.000Z | 2021-12-26T17:40:42.000Z | backend/manage.py | crowdbotics-apps/muddy-term-29546 | 6e530c79087dbd3657982886fc0fe77de21f4adc | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'muddy_term_29546.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
rai... | 28.909091 | 80 | 0.687107 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'muddy_term_29546.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed an... | true | true |
1c3f440a7420883459bb7d4819ae2fbbb608a658 | 425 | py | Python | src/girard/series_convergence.py | gnsantos/solidus | ea4ffcf391ee0e9cf775b984a1aa6776c55ae67e | [
"Apache-2.0"
] | null | null | null | src/girard/series_convergence.py | gnsantos/solidus | ea4ffcf391ee0e9cf775b984a1aa6776c55ae67e | [
"Apache-2.0"
] | null | null | null | src/girard/series_convergence.py | gnsantos/solidus | ea4ffcf391ee0e9cf775b984a1aa6776c55ae67e | [
"Apache-2.0"
] | null | null | null | import numpy as np
def convergence_matrix(spanning_matrix):
grammian_matrix = spanning_matrix.T * spanning_matrix
cm = (-1) * grammian_matrix
np.fill_diagonal(cm, 1)
return cm
def check_convergence(spanning_matrix):
matrix_for_convergence = convergence_matrix(spanning_matrix)
convergence_matri... | 32.692308 | 74 | 0.785882 | import numpy as np
def convergence_matrix(spanning_matrix):
grammian_matrix = spanning_matrix.T * spanning_matrix
cm = (-1) * grammian_matrix
np.fill_diagonal(cm, 1)
return cm
def check_convergence(spanning_matrix):
matrix_for_convergence = convergence_matrix(spanning_matrix)
convergence_matri... | true | true |
1c3f443cdb3a48c534a1d5fa069ce25e9b56958e | 2,812 | py | Python | OPTOSTools/Visualization_CNN/Print_Features.py | Vengadore/Segmentation_OPTOS | d15b6480a567c987b10f7bf680672356e68b7e5b | [
"Apache-2.0"
] | 1 | 2020-10-31T21:01:26.000Z | 2020-10-31T21:01:26.000Z | OPTOSTools/Visualization_CNN/Print_Features.py | Vengadore/Segmentation_OPTOS | d15b6480a567c987b10f7bf680672356e68b7e5b | [
"Apache-2.0"
] | null | null | null | OPTOSTools/Visualization_CNN/Print_Features.py | Vengadore/Segmentation_OPTOS | d15b6480a567c987b10f7bf680672356e68b7e5b | [
"Apache-2.0"
] | null | null | null | import cv2
from tensorflow.keras.models import Model
class Model_CNN:
""" Model_CNN(model)
- Reads a CNN model and looks in the name of the layers for "conv", if found it is saved as an index for extracting feature maps.
model: CNN model to extract feature maps from.
"""
def __init__(s... | 34.716049 | 137 | 0.625178 | import cv2
from tensorflow.keras.models import Model
class Model_CNN:
def __init__(self,model):
self.model = model
self.conv_index = [ind for (ind,layer) in enumerate(model.layers) if "conv" in layer.name]
self.conv_shapes = [(ind,model.layers[ind].name,model.lay... | true | true |
1c3f444859a21cabd7337ae0ebbff4509045aa69 | 505 | py | Python | servio-backend-app/servio/user/migrations/0007_alter_user_service.py | emreerkaslan/SWE573 | 086f44bfbf6feb9629148de820d76aef1088c909 | [
"MIT"
] | null | null | null | servio-backend-app/servio/user/migrations/0007_alter_user_service.py | emreerkaslan/SWE573 | 086f44bfbf6feb9629148de820d76aef1088c909 | [
"MIT"
] | 19 | 2021-10-21T12:43:36.000Z | 2021-12-05T14:21:55.000Z | servio-backend-app/servio/user/migrations/0007_alter_user_service.py | emreerkaslan/Servio | 086f44bfbf6feb9629148de820d76aef1088c909 | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2022-01-02 13:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('service', '0004_alter_service_requests'),
('user', '0006_alter_user_feedbacks_alter_user_following'),
]
operations = [
migrations.Alte... | 25.25 | 100 | 0.637624 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('service', '0004_alter_service_requests'),
('user', '0006_alter_user_feedbacks_alter_user_following'),
]
operations = [
migrations.AlterField(
model_name='user',
... | true | true |
1c3f45dbc1e43153985a7940de0973749caed8f1 | 8,176 | py | Python | examples/basic-tour.py | se-hwan/dynamicCostMPC | f461fe1f9c23783db53dbfe362a26fb33c20a695 | [
"MIT"
] | null | null | null | examples/basic-tour.py | se-hwan/dynamicCostMPC | f461fe1f9c23783db53dbfe362a26fb33c20a695 | [
"MIT"
] | null | null | null | examples/basic-tour.py | se-hwan/dynamicCostMPC | f461fe1f9c23783db53dbfe362a26fb33c20a695 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Basic tour of the Bayesian Optimization package
#
# This is a constrained global optimization package built upon bayesian inference and gaussian process, that attempts to find the maximum value of an unknown function in as few iterations as possible. This technique is particu... | 35.090129 | 558 | 0.74841 |
3)}
optimizer = BayesianOptimization(
f=black_box_function,
pbounds=pbounds,
verbose=2,
random_state=1,
)
optimizer.maximize(
init_points=2,
n_iter=3,
)
print(optimizer.max)
for i, res in enumerate(optimizer.res):
print("Iteration {}: \n\t{}".format(i, res))... | true | true |
1c3f472f9aa622d94beff234a175e42926e0ed64 | 2,813 | py | Python | testing/__init__.py | weltonrodrigo/dumb-init | a0e0776bec98e9a332385b5c320f978b67db193e | [
"MIT"
] | null | null | null | testing/__init__.py | weltonrodrigo/dumb-init | a0e0776bec98e9a332385b5c320f978b67db193e | [
"MIT"
] | null | null | null | testing/__init__.py | weltonrodrigo/dumb-init | a0e0776bec98e9a332385b5c320f978b67db193e | [
"MIT"
] | null | null | null | import errno
import os
import re
import signal
import sys
import time
from contextlib import contextmanager
from subprocess import PIPE
from subprocess import Popen
from py._path.local import LocalPath
# these signals cause dumb-init to suspend itself
SUSPEND_SIGNALS = frozenset([
signal.SIGTSTP,
signal.SIGT... | 25.116071 | 80 | 0.586562 | import errno
import os
import re
import signal
import sys
import time
from contextlib import contextmanager
from subprocess import PIPE
from subprocess import Popen
from py._path.local import LocalPath
SUSPEND_SIGNALS = frozenset([
signal.SIGTSTP,
signal.SIGTTOU,
signal.SIGTTIN,
])
NORMAL_SIGNALS = fro... | true | true |
1c3f475195fe3b3bf6ec44debfc1ea20d2c4a46b | 132 | py | Python | Operator and String/3.5.3.py | ferrerinicolas/python_samples | 107cead4fbee30b275a5e2be1257833129ce5e46 | [
"MIT"
] | null | null | null | Operator and String/3.5.3.py | ferrerinicolas/python_samples | 107cead4fbee30b275a5e2be1257833129ce5e46 | [
"MIT"
] | null | null | null | Operator and String/3.5.3.py | ferrerinicolas/python_samples | 107cead4fbee30b275a5e2be1257833129ce5e46 | [
"MIT"
] | null | null | null | print("hello " + ", world!")
print("a" + "b" + "c")
print("hi" * 3)
print("hi" + str(3))
print("My bike has " + str(6) + " gears.") | 22 | 42 | 0.492424 | print("hello " + ", world!")
print("a" + "b" + "c")
print("hi" * 3)
print("hi" + str(3))
print("My bike has " + str(6) + " gears.") | true | true |
1c3f47f1ed2669ba90d5a94b8c0f1e2af675c37d | 4,933 | py | Python | Message/InfoMessage_pb2.py | qikkDB/qikkdb-python-network-client | 3e5c6ed3e13957dbc16b5bf9fdefe92e5cf054d3 | [
"Apache-2.0"
] | 5 | 2020-06-30T11:55:26.000Z | 2021-04-24T00:05:35.000Z | Message/InfoMessage_pb2.py | qikkDB/qikkdb-python-network-client | 3e5c6ed3e13957dbc16b5bf9fdefe92e5cf054d3 | [
"Apache-2.0"
] | null | null | null | Message/InfoMessage_pb2.py | qikkDB/qikkdb-python-network-client | 3e5c6ed3e13957dbc16b5bf9fdefe92e5cf054d3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: Message/InfoMessage.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database ... | 36.272059 | 540 | 0.759376 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='Mess... | true | true |
1c3f4846e299df5f15a74d0917ad5deaac68416d | 3,827 | bzl | Python | kythe/cxx/extractor/proto/testdata/proto_extractor_test.bzl | bef0/kythe | 2adcb540ae9dbd61879315a5ade8d3716ee3d3d8 | [
"Apache-2.0"
] | null | null | null | kythe/cxx/extractor/proto/testdata/proto_extractor_test.bzl | bef0/kythe | 2adcb540ae9dbd61879315a5ade8d3716ee3d3d8 | [
"Apache-2.0"
] | null | null | null | kythe/cxx/extractor/proto/testdata/proto_extractor_test.bzl | bef0/kythe | 2adcb540ae9dbd61879315a5ade8d3716ee3d3d8 | [
"Apache-2.0"
] | null | null | null | """Rules for testing the proto extractor"""
# Copyright 2018 The Kythe 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/LICE... | 31.891667 | 92 | 0.617455 |
load("@bazel_skylib//lib:dicts.bzl", "dicts")
def _extract_kzip_impl(ctx):
cmd = [ctx.executable.extractor.path] + [p.path for p in ctx.files.srcs] + ctx.attr.opts
ctx.actions.run_shell(
mnemonic = "Extract",
command = " ".join(cmd),
env = dicts.add(ctx.attr.extra_env, {"... | true | true |
1c3f48a57d298503af69686a178411f43a22f4da | 1,767 | py | Python | src/training/models/test_siamese2.py | rogov-dvp/medical-imaging-matching | ab5dd4c4f4422c170adb2a3228fcb88fb2a5ffe4 | [
"MIT"
] | 1 | 2021-12-15T06:36:25.000Z | 2021-12-15T06:36:25.000Z | src/training/models/test_siamese2.py | rogov-dvp/medical-imaging-matching | ab5dd4c4f4422c170adb2a3228fcb88fb2a5ffe4 | [
"MIT"
] | 179 | 2021-09-29T15:33:24.000Z | 2022-03-31T23:22:31.000Z | src/training/models/test_siamese2.py | rogov-dvp/medical-imaging-matching | ab5dd4c4f4422c170adb2a3228fcb88fb2a5ffe4 | [
"MIT"
] | null | null | null | # Testing: Make sure model grabs image or is grabbing correct image
# each component doing what it is meant too
import unittest
import matplotlib.pyplot as plt
import numpy as np
import os
import cv2
import random
import tensorflow as tf
from siamese2 import SiameseModel
class TestSiamese2(unittest.TestCase):
d... | 22.948052 | 124 | 0.602716 |
import unittest
import matplotlib.pyplot as plt
import numpy as np
import os
import cv2
import random
import tensorflow as tf
from siamese2 import SiameseModel
class TestSiamese2(unittest.TestCase):
def test_preprocess_image(self):
"""
Tests images correctly load
"""
de... | false | true |
1c3f48aae9ca9fd09823987c78cc87743fd28899 | 13,330 | py | Python | kubernetes_asyncio/client/models/v1_node_system_info.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1_node_system_info.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1_node_system_info.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.13.5
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1NodeSyst... | 35.35809 | 267 | 0.64051 |
import pprint
import re
import six
class V1NodeSystemInfo(object):
openapi_types = {
'architecture': 'str',
'boot_id': 'str',
'container_runtime_version': 'str',
'kernel_version': 'str',
'kube_proxy_version': 'str',
'kubelet_version': 'str',
'machine... | true | true |
1c3f49404e6dd0c5ad52a00fb049a2addc5ae17b | 725 | py | Python | udsoncan/configs.py | marchcui/pythUDS | 3012c716299730c23f58d7e545d5bb22f301d1c7 | [
"MIT"
] | null | null | null | udsoncan/configs.py | marchcui/pythUDS | 3012c716299730c23f58d7e545d5bb22f301d1c7 | [
"MIT"
] | null | null | null | udsoncan/configs.py | marchcui/pythUDS | 3012c716299730c23f58d7e545d5bb22f301d1c7 | [
"MIT"
] | null | null | null | default_client_config = {
'exception_on_negative_response' : True,
'exception_on_invalid_response' : True,
'exception_on_unexpected_response' : True,
'security_algo' : None,
'security_algo_params' : None,
'tolerate_zero_padding' : True,
'ignore_all_zero_dt... | 40.277778 | 106 | 0.594483 | default_client_config = {
'exception_on_negative_response' : True,
'exception_on_invalid_response' : True,
'exception_on_unexpected_response' : True,
'security_algo' : None,
'security_algo_params' : None,
'tolerate_zero_padding' : True,
'ignore_all_zero_dt... | true | true |
1c3f49ed42a717f7d956ed34ca2195e2690c3b1b | 2,118 | py | Python | tests/test_plugin_collector.py | AdamGleave/pytest-notebook | 94df07bb0138bc677de9842aca8f5acd44c58677 | [
"BSD-3-Clause"
] | null | null | null | tests/test_plugin_collector.py | AdamGleave/pytest-notebook | 94df07bb0138bc677de9842aca8f5acd44c58677 | [
"BSD-3-Clause"
] | null | null | null | tests/test_plugin_collector.py | AdamGleave/pytest-notebook | 94df07bb0138bc677de9842aca8f5acd44c58677 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Test the plugin collection and direct invocation of notebooks."""
import os
PATH = os.path.dirname(os.path.realpath(__file__))
def copy_nb_to_tempdir(in_name="different_outputs.ipynb", out_name="test_nb.ipynb"):
with open(os.path.join(PATH, "raw_files", in_name), "rb") as handle:
... | 32.584615 | 84 | 0.655807 |
import os
PATH = os.path.dirname(os.path.realpath(__file__))
def copy_nb_to_tempdir(in_name="different_outputs.ipynb", out_name="test_nb.ipynb"):
with open(os.path.join(PATH, "raw_files", in_name), "rb") as handle:
data = handle.read()
with open(out_name, "wb") as handle:
handle.write(data)
... | true | true |
1c3f4a8ff00b30d0100ea2e67dc64c1c4a865a9a | 662 | py | Python | setup.py | JartC0ding/Encrypto | 1a094b8e657d48d335b1b9a2d419edbd311e1cc9 | [
"Apache-2.0"
] | null | null | null | setup.py | JartC0ding/Encrypto | 1a094b8e657d48d335b1b9a2d419edbd311e1cc9 | [
"Apache-2.0"
] | null | null | null | setup.py | JartC0ding/Encrypto | 1a094b8e657d48d335b1b9a2d419edbd311e1cc9 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Operating System :: Microsoft :: Windows :: Windows 10",
"License :: Apache License 2.0",
"Programming Language :: Python :: 3"
]
setup(
name="Encrypto",
vers... | 26.48 | 59 | 0.676737 | from setuptools import setup, find_packages
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Operating System :: Microsoft :: Windows :: Windows 10",
"License :: Apache License 2.0",
"Programming Language :: Python :: 3"
]
setup(
name="Encrypto",
vers... | true | true |
1c3f4b0354fb050dc4cc0435b92018ab52be6e22 | 477 | py | Python | wooey/__init__.py | 8dspaces/Wooey-Flask | 44d3ce02474859cdd8d6f1138ba48ce62b739524 | [
"BSD-3-Clause"
] | 1 | 2020-11-05T15:04:33.000Z | 2020-11-05T15:04:33.000Z | wooey/__init__.py | 8dspaces/Wooey-Flask | 44d3ce02474859cdd8d6f1138ba48ce62b739524 | [
"BSD-3-Clause"
] | null | null | null | wooey/__init__.py | 8dspaces/Wooey-Flask | 44d3ce02474859cdd8d6f1138ba48ce62b739524 | [
"BSD-3-Clause"
] | null | null | null | from . import version
import os
if version.DJANGO_VERSION >= version.DJ17:
default_app_config = 'wooey.apps.WooeyConfig'
else:
if os.environ.get('TESTING') != 'True':
from . import settings as wooey_settings
# we need to call from within wooey_settings so the celery/etc vars are setup
if... | 36.692308 | 85 | 0.69392 | from . import version
import os
if version.DJANGO_VERSION >= version.DJ17:
default_app_config = 'wooey.apps.WooeyConfig'
else:
if os.environ.get('TESTING') != 'True':
from . import settings as wooey_settings
if not wooey_settings.settings.configured:
wooey_settings.settings.... | true | true |
1c3f4c8e6de51b62e6abfebe7b9516db38d53f2d | 279 | py | Python | tests/test_run_times/__init__.py | James-Montgomery/platea | 96188d34293d46ddc3f9935fe1349f83f72c13a8 | [
"MIT"
] | null | null | null | tests/test_run_times/__init__.py | James-Montgomery/platea | 96188d34293d46ddc3f9935fe1349f83f72c13a8 | [
"MIT"
] | null | null | null | tests/test_run_times/__init__.py | James-Montgomery/platea | 96188d34293d46ddc3f9935fe1349f83f72c13a8 | [
"MIT"
] | null | null | null | """
Run Times
=====
Run time evaluation of functions in Platea.
"""
# # Example of per line run time diagnostic
# import cProfile
# import platea.random_number_generators as rng
# ran = rng.Ran0(seed=-99999)
# ran_draw = ran.draw
# cProfile.run("ran_draw(100000)", sort="time")
| 21.461538 | 47 | 0.713262 | true | true | |
1c3f4ce11391295ce698b0c6e4455c5e0de17368 | 11,558 | py | Python | config.py | aimakerspace/synergos_director | c4b10502d7ffa6da4fc29fe675a5042590657996 | [
"Apache-2.0"
] | null | null | null | config.py | aimakerspace/synergos_director | c4b10502d7ffa6da4fc29fe675a5042590657996 | [
"Apache-2.0"
] | null | null | null | config.py | aimakerspace/synergos_director | c4b10502d7ffa6da4fc29fe675a5042590657996 | [
"Apache-2.0"
] | 2 | 2022-01-21T00:57:00.000Z | 2022-01-26T01:11:12.000Z | #!/usr/bin/env python
####################
# Required Modules #
####################
# Generic
import json
import logging
import os
import random
import subprocess
from collections import defaultdict, OrderedDict
from glob import glob
from pathlib import Path
from string import Template
# Libs
import numpy as np
imp... | 31.069892 | 89 | 0.655304 |
k=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True
)
all_detected_devices = process.stdout.split('\n')
gpus = [
device
for device in all_detected_devices
if (('VGA' in device) or ('Display' in device)) ... | true | true |
1c3f4e2283a2ca09974785f1d9bc5acbdf5ae2f9 | 2,448 | py | Python | config.py | Jackson-Kang/VQVC-Pytorch | d2267b5c52253b6ae11a5767963a65320ae335c2 | [
"MIT"
] | 13 | 2021-02-11T17:48:40.000Z | 2022-02-08T06:37:12.000Z | config.py | Jackson-Kang/VQVC-Pytorch | d2267b5c52253b6ae11a5767963a65320ae335c2 | [
"MIT"
] | 1 | 2022-01-17T17:07:22.000Z | 2022-01-18T06:51:21.000Z | config.py | Jackson-Kang/VQVC-Pytorch | d2267b5c52253b6ae11a5767963a65320ae335c2 | [
"MIT"
] | 3 | 2021-03-10T08:40:00.000Z | 2022-01-17T17:08:48.000Z | import torch
from utils.path import get_path
class Arguments:
"""
path configurations
"""
dataset_name = "VCTK-Corpus"
dataset_path = get_path("/home/minsu/dataset/VCTK/", dataset_name)
converted_sample_dir = "results"
prepro_dir = "preprocessed"
model_log_dir = "logs"
model_checkpoint_dir = "ckpts"
... | 23.76699 | 128 | 0.747549 | import torch
from utils.path import get_path
class Arguments:
dataset_name = "VCTK-Corpus"
dataset_path = get_path("/home/minsu/dataset/VCTK/", dataset_name)
converted_sample_dir = "results"
prepro_dir = "preprocessed"
model_log_dir = "logs"
model_checkpoint_dir = "ckpts"
wav_dir = get_path(dataset_path... | true | true |
1c3f4e978bc8466505b3f34142a058a11b694f7f | 56,611 | py | Python | theano/gof/op.py | canyon289/Theano-PyMC | 1a9b04bfe480b758ddfa54ba49c88bee3bec419c | [
"BSD-3-Clause"
] | null | null | null | theano/gof/op.py | canyon289/Theano-PyMC | 1a9b04bfe480b758ddfa54ba49c88bee3bec419c | [
"BSD-3-Clause"
] | null | null | null | theano/gof/op.py | canyon289/Theano-PyMC | 1a9b04bfe480b758ddfa54ba49c88bee3bec419c | [
"BSD-3-Clause"
] | null | null | null | """
Defines base classes `Op`, `PureOp`, and `CLinkerOp`.
The `Op` class is the base interface for all operations
compatible with `gof`'s :doc:`graph` routines.
"""
import copy
import inspect
import logging
import os
import re
import sys
import warnings
import numpy as np
import theano
import theano.gof.cc
from the... | 34.309697 | 108 | 0.584639 | import copy
import inspect
import logging
import os
import re
import sys
import warnings
import numpy as np
import theano
import theano.gof.cc
from theano import config
from theano.gof import graph
from theano.gof.cmodule import GCC_compiler
from theano.gof.fg import FunctionGraph
from theano.gof.utils import (
M... | true | true |
1c3f4ea74f0df3431f7567da5cfc25b5846263c0 | 904 | py | Python | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projects-DS/Data-Structures/lru_cache/lru_cache.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 5 | 2021-06-02T23:44:25.000Z | 2021-12-27T16:21:57.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projects-DS/Data-Structures/lru_cache/lru_cache.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 22 | 2021-05-31T01:33:25.000Z | 2021-10-18T18:32:39.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projects-DS/Data-Structures/lru_cache/lru_cache.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 3 | 2021-06-19T03:37:47.000Z | 2021-08-31T00:49:51.000Z | class LRUCache:
def __init__(self, limit=10):
pass
"""
Retrieves the value associated with the given key. Also
needs to move the key-value pair to the top of the order
such that the pair is considered most-recently used.
Returns the value associated with the key or None if the
key-value pair ... | 31.172414 | 62 | 0.702434 | class LRUCache:
def __init__(self, limit=10):
pass
def get(self, key):
pass
def set(self, key, value):
pass
| true | true |
1c3f4f64643e9db00643465b6d7976dc2f3815f0 | 23,787 | py | Python | code/run_fewrel.py | Riroaki/ERNIE | ad59b5e7cbad83247a123705ef2d64f65d0cfbf7 | [
"MIT"
] | 1,382 | 2019-05-17T07:55:01.000Z | 2022-03-30T02:47:06.000Z | all_exp/ernie/code/code/run_fewrel.py | yifan-h/GCS_KI | 5d5c68832aa37cefb1d01723c35fc3d74482c8c2 | [
"MIT"
] | 80 | 2019-05-20T01:45:37.000Z | 2022-02-17T14:33:17.000Z | all_exp/ernie/code/code/run_fewrel.py | yifan-h/GCS_KI | 5d5c68832aa37cefb1d01723c35fc3d74482c8c2 | [
"MIT"
] | 257 | 2019-05-18T10:39:18.000Z | 2022-03-21T15:23:41.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace 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 copy... | 42.859459 | 130 | 0.59213 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import os
import logging
import argparse
import random
from tqdm import tqdm, trange
import simplejson as json
import numpy as np
import torch
from torch.utils.data import TensorData... | true | true |
1c3f505cbd7250fbf9f886f196440d28e9b05cca | 572 | py | Python | 00-modules/builtin_modules/shutil_examples.py | cccaaannn/useful_functions | 1570cda8c642a39f04ed9f22ebeeab2bfb9e9424 | [
"MIT"
] | null | null | null | 00-modules/builtin_modules/shutil_examples.py | cccaaannn/useful_functions | 1570cda8c642a39f04ed9f22ebeeab2bfb9e9424 | [
"MIT"
] | null | null | null | 00-modules/builtin_modules/shutil_examples.py | cccaaannn/useful_functions | 1570cda8c642a39f04ed9f22ebeeab2bfb9e9424 | [
"MIT"
] | null | null | null | import shutil
# https://docs.python.org/2/library/shutil.html
src = ""
dst = ""
# move
shutil.move(src, dst)
# copy
shutil.copy(src, dst)
# copy2 also copies metadata
shutil.copy2(src, dst)
# copy file works faster but it only copies files
shutil.copyfile(src, dst)
# copies metadata
shutil.copystat(src, dst)
#... | 17.875 | 49 | 0.729021 | import shutil
src = ""
dst = ""
shutil.move(src, dst)
shutil.copy(src, dst)
shutil.copy2(src, dst)
shutil.copyfile(src, dst)
shutil.copystat(src, dst)
ignore = shutil.ignore_patterns('*.pyc', 'tmp*')
shutil.copytree(src, dst, ignore=ignore)
shutil.rmtree(src)
shutil.make_archive(dst+".zip", 'zip', s... | true | true |
1c3f51f3327cf445677987a7a1e883c763e01bb9 | 82,241 | py | Python | mindspore/python/mindspore/train/serialization.py | glucklichste/mindspore | 9df63697af663836fc18d03fef40715f093a3fa1 | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/train/serialization.py | glucklichste/mindspore | 9df63697af663836fc18d03fef40715f093a3fa1 | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/train/serialization.py | glucklichste/mindspore | 9df63697af663836fc18d03fef40715f093a3fa1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2021 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 applicable law or agre... | 47.156537 | 120 | 0.640398 |
import copy
import json
import os
import shutil
import stat
import threading
from threading import Thread, Lock
from collections import defaultdict
import math
import sys
import time
import numpy as np
from mindspore.train.checkpoint_pb2 import Checkpoint
from mindspore.train.mind_ir_pb2 import ModelP... | true | true |
1c3f5220100276b5490f58e7a181978bffecebdd | 12,233 | py | Python | gplearn/_programparser.py | vossjo/gplearn | 105181fd020da11bc36b7e31c95f115dd7f05c21 | [
"BSD-3-Clause"
] | null | null | null | gplearn/_programparser.py | vossjo/gplearn | 105181fd020da11bc36b7e31c95f115dd7f05c21 | [
"BSD-3-Clause"
] | null | null | null | gplearn/_programparser.py | vossjo/gplearn | 105181fd020da11bc36b7e31c95f115dd7f05c21 | [
"BSD-3-Clause"
] | 1 | 2022-03-08T22:42:00.000Z | 2022-03-08T22:42:00.000Z | """Genetic Programming in Python, with a scikit-learn inspired API
The :mod:`gplearn._programparser` module implements symbolic simplification
of programs via sympy and optimization of numerical parameters via scipy.
"""
# Author: Johannes Voss <https://stanford.edu/~vossj/main/>
#
# Additions to and based on gplearn... | 31.609819 | 171 | 0.575738 |
from .functions import _Function, _protected_division
import numpy as np
from scipy import optimize
from sympy import symbols, simplify
import ast
def parseexpr(x, fun_list, params):
if isinstance(x, ast.BinOp):
l = parseexpr(x.left, fun_list, params)
r = parseexpr(x.right, fun_list, param... | true | true |
1c3f528e021aeacde8c3005be959336163200770 | 1,347 | py | Python | designer_family/tests/unit/objects/base.py | guishaowu/designer_family | c89e16c6649c181f3262aa65fa97a457abdc2eb2 | [
"Apache-2.0"
] | null | null | null | designer_family/tests/unit/objects/base.py | guishaowu/designer_family | c89e16c6649c181f3262aa65fa97a457abdc2eb2 | [
"Apache-2.0"
] | null | null | null | designer_family/tests/unit/objects/base.py | guishaowu/designer_family | c89e16c6649c181f3262aa65fa97a457abdc2eb2 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 37.416667 | 78 | 0.724573 |
from oslo_config import cfg
from oslo_config import fixture as config_fixture
from designer_family import conf
from designer_family import context
from designer_family.tests.unit import base as unit_base
class TestCase(unit_base.ContextTestCase):
def setUp(self):
super(TestCase, self).setUp(... | true | true |
1c3f52e0ce89f75b895b86619db16ae1c51d37bb | 1,129 | py | Python | Configuration/Generator/python/QCD_Pt_170_230_8TeV_TuneCUETP8M1_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Configuration/Generator/python/QCD_Pt_170_230_8TeV_TuneCUETP8M1_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Configuration/Generator/python/QCD_Pt_170_230_8TeV_TuneCUETP8M1_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter",
pythiaPylistVerbosity = cms.untracked.int32(0),
... | 45.16 | 74 | 0.54473 | import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter",
pythiaPylistVerbosity = cms.untracked.int32(0),
... | true | true |
1c3f5306df67d7a75fd8af47523e27b24b36c9e1 | 46,386 | py | Python | testing/shell_script_testing/shell_script_testing.py | ncsa/NCSA-Genomics_MGC_GenomeGPS_CromwelWDL | 4611896ea1bb50df50120752712e8d4b32a6d023 | [
"MIT"
] | null | null | null | testing/shell_script_testing/shell_script_testing.py | ncsa/NCSA-Genomics_MGC_GenomeGPS_CromwelWDL | 4611896ea1bb50df50120752712e8d4b32a6d023 | [
"MIT"
] | null | null | null | testing/shell_script_testing/shell_script_testing.py | ncsa/NCSA-Genomics_MGC_GenomeGPS_CromwelWDL | 4611896ea1bb50df50120752712e8d4b32a6d023 | [
"MIT"
] | null | null | null | import sys
import os
import subprocess
import unittest
import time
import glob
import copy
class Script:
"""
Trim_sequences is done, and the other scripts will have similar setups that have the flags as attributes so tests
can step through the list of attributes.
"""
__cwd = os.getcwd()
def _... | 48.87882 | 165 | 0.587246 | import sys
import os
import subprocess
import unittest
import time
import glob
import copy
class Script:
__cwd = os.getcwd()
def __init__(self):
self.path = self.__cwd
self.shell_path = '{}/MayomicsVC/src/shell'.format(self.__cwd)
self.test_path = '{}/MayomicsVC/testing/shell_script_t... | true | true |
1c3f53db2528a3e9ce469c7860b1e1d14e83ccaa | 4,237 | py | Python | setup.py | taesko/fst | e95b0d45ef1c181831c741604893bdc26753e551 | [
"MIT"
] | null | null | null | setup.py | taesko/fst | e95b0d45ef1c181831c741604893bdc26753e551 | [
"MIT"
] | null | null | null | setup.py | taesko/fst | e95b0d45ef1c181831c741604893bdc26753e551 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Package meta-data.
NAME = "fst"
DESCRIPTION = "FIle System Templates... | 28.436242 | 81 | 0.632287 |
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
NAME = "fst"
DESCRIPTION = "FIle System Templates"
URL = "https://github.com/taesko/{}".format(NAME)
EMAIL = "taeskow@gmail.com"
AUTHOR = "Antonio Todorov"
REQUIRED = ["watchdog"]
# ---------------... | true | true |
1c3f5460a679d91aa7db89a2dd12f4a382a12cda | 5,474 | py | Python | CaloOnlineTools/EcalTools/python/ecalTPGAnalyzer_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CaloOnlineTools/EcalTools/python/ecalTPGAnalyzer_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CaloOnlineTools/EcalTools/python/ecalTPGAnalyzer_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("ANALYSEMIP")
# Trigger ###
process.load("L1TriggerConfig.L1GtConfigProducers.L1GtConfig_cff")
process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_startup_v3_Unprescaled_cff")
process.load("L1TriggerConfig.L1GtConfigProducers.L1GtB... | 35.545455 | 162 | 0.744611 | import FWCore.ParameterSet.Config as cms
process = cms.Process("ANALYSEMIP")
ss.load("L1TriggerConfig.L1GtConfigProducers.L1GtConfig_cff")
process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_startup_v3_Unprescaled_cff")
process.load("L1TriggerConfig.L1GtConfigProducers.L1GtBoardMapsConfig_cff"... | true | true |
1c3f54662a8092706e730b229cd7d7a8f279d218 | 897 | py | Python | share/qt/clean_mac_info_plist.py | zahidaliayub/DaMaCoin | 2c19cc44358e8701ed1cc0f91ddd9dd6fa5ff64b | [
"MIT"
] | 2 | 2017-11-15T11:32:50.000Z | 2018-01-26T05:33:06.000Z | share/qt/clean_mac_info_plist.py | zahidaliayub/DaMaCoin | 2c19cc44358e8701ed1cc0f91ddd9dd6fa5ff64b | [
"MIT"
] | 2 | 2015-12-29T22:15:25.000Z | 2017-03-25T00:44:09.000Z | share/qt/clean_mac_info_plist.py | zahidaliayub/DaMaCoin | 2c19cc44358e8701ed1cc0f91ddd9dd6fa5ff64b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the DaMaCoin-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from string import Template
from datetime import date
bitcoinDir = "./";
in... | 29.9 | 109 | 0.725753 |
from string import Template
from datetime import date
bitcoinDir = "./";
inFile = bitcoinDir+"/share/qt/Info.plist"
outFile = "DaMaCoin-Qt.app/Contents/Info.plist"
version = "unknown";
fileForGrabbingVersion = bitcoinDir+"bitcoin-qt.pro"
for line in open(fileForGrabbingVersion):
lineArr = line.replac... | false | true |
1c3f5487bb649785d318fed288f3c338b2157c1a | 529 | py | Python | testplan/runnable/interactive/resource_loader.py | Morgan-Stanley/Testplan | 9374d6e0da6ae9aa7a1b5e08b42cd21993485837 | [
"Apache-2.0"
] | null | null | null | testplan/runnable/interactive/resource_loader.py | Morgan-Stanley/Testplan | 9374d6e0da6ae9aa7a1b5e08b42cd21993485837 | [
"Apache-2.0"
] | null | null | null | testplan/runnable/interactive/resource_loader.py | Morgan-Stanley/Testplan | 9374d6e0da6ae9aa7a1b5e08b42cd21993485837 | [
"Apache-2.0"
] | null | null | null | """Import classes on runtime."""
class ResourceLoader:
"""Load logic."""
def load(self, name, kwargs):
"""Load the registered object for the given name."""
target_class = getattr(self, "_load_{}".format(name))()
return target_class(**kwargs)
def _load_TCPServer(self):
fro... | 25.190476 | 67 | 0.661626 |
class ResourceLoader:
def load(self, name, kwargs):
target_class = getattr(self, "_load_{}".format(name))()
return target_class(**kwargs)
def _load_TCPServer(self):
from testplan.testing.multitest.driver.tcp import TCPServer
return TCPServer
def _load_TCPClient(self):
... | true | true |
1c3f55051364d029230f8d099b1f020f5fee8e45 | 13,587 | py | Python | escola/tests/test_functional.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 1 | 2019-03-15T18:04:24.000Z | 2019-03-15T18:04:24.000Z | escola/tests/test_functional.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 22 | 2019-03-17T21:53:50.000Z | 2021-03-31T19:12:19.000Z | escola/tests/test_functional.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 1 | 2018-11-25T03:05:23.000Z | 2018-11-25T03:05:23.000Z | # Developed by Vinicius José Fritzen
# Last Modified 16/05/19 16:44.
# Copyright (c) 2019 Vinicius José Fritzen and Albert Angel Lanzarini
import logging
import time
import pytest
from django.test import TestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
TIME_LOAD = 2
logger ... | 44.841584 | 138 | 0.707294 |
import logging
import time
import pytest
from django.test import TestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
TIME_LOAD = 2
logger = logging.getLogger(__name__)
def HeaderWrongMsg(expected, recieved):
return f"O titulo no HEAD da pagina não é '{expected}', e ... | true | true |
1c3f558452fe4d4e193c488525a9e64c73a76bd9 | 855 | py | Python | googler/utils/compat.py | commx/googler | 6b834a3248ac297f1e1a75af3c622a0f37b34a0a | [
"Apache-2.0"
] | 2 | 2016-01-13T09:12:20.000Z | 2016-03-13T10:42:21.000Z | googler/utils/compat.py | commx/googler | 6b834a3248ac297f1e1a75af3c622a0f37b34a0a | [
"Apache-2.0"
] | 1 | 2018-11-11T16:40:41.000Z | 2018-11-11T16:40:41.000Z | googler/utils/compat.py | commx/googler | 6b834a3248ac297f1e1a75af3c622a0f37b34a0a | [
"Apache-2.0"
] | 1 | 2017-12-26T08:53:40.000Z | 2017-12-26T08:53:40.000Z | ##
# Copyright (C) 2015 Christian Jurk <commx@commx.ws>
#
# 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... | 27.580645 | 74 | 0.729825 |
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY2:
text_type = unicode
bytes_type = str
from urllib import urlencode
else:
text_type = str
bytes_type = bytes
from urllib.parse import urlencode | true | true |
1c3f55ec18411adfef510553a7c3bbc52d63deba | 4,221 | py | Python | setup.py | Rippling/mongoengine | c3b6fa6ffdfe05fcf6f49857c1a89fee0175a05f | [
"MIT"
] | null | null | null | setup.py | Rippling/mongoengine | c3b6fa6ffdfe05fcf6f49857c1a89fee0175a05f | [
"MIT"
] | 28 | 2016-11-30T03:15:18.000Z | 2022-02-25T15:57:02.000Z | setup.py | Rippling/mongoengine | c3b6fa6ffdfe05fcf6f49857c1a89fee0175a05f | [
"MIT"
] | 1 | 2021-11-10T05:33:18.000Z | 2021-11-10T05:33:18.000Z | from __future__ import absolute_import
import os
import sys
from setuptools import setup, find_packages
# Hack to silence atexit traceback in newer python versions
try:
import multiprocessing
except ImportError:
pass
DESCRIPTION = 'MongoEngine is a Python Object-Document ' + \
'Mapper for working with MongoDB... | 37.6875 | 119 | 0.664534 | from __future__ import absolute_import
import os
import sys
from setuptools import setup, find_packages
try:
import multiprocessing
except ImportError:
pass
DESCRIPTION = 'MongoEngine is a Python Object-Document ' + \
'Mapper for working with MongoDB.'
try:
with open('README.rst') as fin:
LONG_D... | true | true |
1c3f560d6e75286729123a801fbff679f21bbc87 | 7,466 | py | Python | django/db/migrations/migration.py | xia0AL/baby_two | 70244363024a36463dfaeda64e9e95ac118e1934 | [
"BSD-3-Clause"
] | 1 | 2016-02-13T15:40:02.000Z | 2016-02-13T15:40:02.000Z | django/db/migrations/migration.py | ojengwa/django-1 | f6b09a7f85c3b67b2011553838b079788c413432 | [
"BSD-3-Clause"
] | null | null | null | django/db/migrations/migration.py | ojengwa/django-1 | f6b09a7f85c3b67b2011553838b079788c413432 | [
"BSD-3-Clause"
] | 1 | 2022-03-26T09:05:09.000Z | 2022-03-26T09:05:09.000Z | from __future__ import unicode_literals
from django.db.transaction import atomic
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Migration(object):
"""
The base class for all migrations.
Migration files will import this from django.db.migrations.Migration... | 41.709497 | 109 | 0.648674 | from __future__ import unicode_literals
from django.db.transaction import atomic
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Migration(object):
operations = []
dependencies = []
run_before = []
# Migration names in... | true | true |
1c3f566ac5de92909c6d445e415ff2cdc4cd53d2 | 2,184 | py | Python | main.py | rnoguer22/Ejercicios_Herencia_POO | 0e18fe1edf262f20b95cc0b40d7e61c4be31ec0d | [
"Apache-2.0"
] | null | null | null | main.py | rnoguer22/Ejercicios_Herencia_POO | 0e18fe1edf262f20b95cc0b40d7e61c4be31ec0d | [
"Apache-2.0"
] | null | null | null | main.py | rnoguer22/Ejercicios_Herencia_POO | 0e18fe1edf262f20b95cc0b40d7e61c4be31ec0d | [
"Apache-2.0"
] | null | null | null | from Clases.ejercicio1 import *
from Clases.Puzzle import *
from Clases.Herencia_multiple_caso_real import *
if __name__ == "__main__":
#EJERCICIO 1
punto1 = Punto2D(3,2)
punto1.traslacion(1,1)
print("El nuevo valor de punto1 es ({},{})".format(punto1.x,punto1.y))
punto2 = Punto3D(1,1,1)
... | 36.4 | 111 | 0.625916 | from Clases.ejercicio1 import *
from Clases.Puzzle import *
from Clases.Herencia_multiple_caso_real import *
if __name__ == "__main__":
punto1 = Punto2D(3,2)
punto1.traslacion(1,1)
print("El nuevo valor de punto1 es ({},{})".format(punto1.x,punto1.y))
punto2 = Punto3D(1,1,1)
punto2.trasl... | true | true |
1c3f571eacb5844d4f1d6425820e62fc84c1eb66 | 1,739 | py | Python | beginning-game-development/Chapter 7/7-4.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | 43 | 2015-09-20T02:05:48.000Z | 2022-03-01T22:00:43.000Z | beginning-game-development/Chapter 7/7-4.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | beginning-game-development/Chapter 7/7-4.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | 40 | 2015-05-19T06:51:13.000Z | 2022-03-27T18:11:16.000Z | class World(object):
def __init__(self):
self.entities = {} # Store all the entities
self.entity_id = 0 # Last entity id assigned
# Draw the nest (a circle) on the background
self.background = pygame.surface.Surface(SCREEN_SIZE).convert()
self.background.fill((255, 255, 255... | 31.053571 | 91 | 0.626797 | class World(object):
def __init__(self):
self.entities = {}
self.entity_id = 0
self.background = pygame.surface.Surface(SCREEN_SIZE).convert()
self.background.fill((255, 255, 255))
pygame.draw.circle(self.background, (200, 255, 200), NEST_POSITION, int(NEST_SIZE... | true | true |
1c3f581920ca6d909ea815a12c43b203410bfd34 | 1,113 | py | Python | bluelog/extensions.py | meizhaohui/bluelog | e4ea274cec5abe78b142f23f99675d3fdf5f1170 | [
"MIT"
] | null | null | null | bluelog/extensions.py | meizhaohui/bluelog | e4ea274cec5abe78b142f23f99675d3fdf5f1170 | [
"MIT"
] | null | null | null | bluelog/extensions.py | meizhaohui/bluelog | e4ea274cec5abe78b142f23f99675d3fdf5f1170 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
@Author : Zhaohui Mei(梅朝辉)
@Email : mzh.whut@gmail.com
@Time : 2018/11/18 20:53
@File : extensions.py
@Version : 1.0
@Interpreter: Python3.6.2
@Software: PyCharm
@Description: 扩展类实例化
"""
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from ... | 25.295455 | 73 | 0.728661 |
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from flask_moment import Moment
from flask_ckeditor import CKEditor
from flask_mail import Mail
from flask_login import LoginManager
from flask_wtf.csrf import CSRFProtect
bootstrap = Bootstrap()
db = SQLAlchemy()
moment = Moment... | true | true |
1c3f596687b3a50588950fdfed39db230aa16475 | 470 | py | Python | apps/fhir/bluebutton/migrations/0004_auto_20191220_2327.py | dtisza1/bluebutton-web-server | 6322f28d75bd9e00f8dc4b5988a0cd5f7c6c80cb | [
"Apache-2.0"
] | 25 | 2017-12-10T00:48:31.000Z | 2022-03-25T01:29:13.000Z | apps/fhir/bluebutton/migrations/0004_auto_20191220_2327.py | dtisza1/bluebutton-web-server | 6322f28d75bd9e00f8dc4b5988a0cd5f7c6c80cb | [
"Apache-2.0"
] | 298 | 2017-12-05T05:53:32.000Z | 2022-03-21T19:29:03.000Z | apps/fhir/bluebutton/migrations/0004_auto_20191220_2327.py | dtisza1/bluebutton-web-server | 6322f28d75bd9e00f8dc4b5988a0cd5f7c6c80cb | [
"Apache-2.0"
] | 31 | 2017-12-04T16:01:12.000Z | 2021-09-26T22:34:55.000Z | # Generated by Django 2.1.11 on 2019-12-20 23:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bluebutton', '0003_auto_20191208_0010'),
]
operations = [
migrations.AlterField(
model_name='crosswalk',
name='_fhi... | 24.736842 | 125 | 0.634043 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bluebutton', '0003_auto_20191208_0010'),
]
operations = [
migrations.AlterField(
model_name='crosswalk',
name='_fhir_id',
field=models.CharField(db_col... | true | true |
1c3f59d5dbbbcbb7939d11d02a3a33cb0fbdc48a | 1,374 | py | Python | lib/cogs/commands/Utility.py | Aqua-Solutions2/Aqua-Solutions-Partner | dfc27c77560c2e209b9aef003694641d07027950 | [
"MIT"
] | null | null | null | lib/cogs/commands/Utility.py | Aqua-Solutions2/Aqua-Solutions-Partner | dfc27c77560c2e209b9aef003694641d07027950 | [
"MIT"
] | null | null | null | lib/cogs/commands/Utility.py | Aqua-Solutions2/Aqua-Solutions-Partner | dfc27c77560c2e209b9aef003694641d07027950 | [
"MIT"
] | null | null | null | from discord.ext.commands import Cog, command, cooldown, BucketType
import time
start_time = time.time()
class Stats(Cog):
def __init__(self, bot):
self.bot = bot
@staticmethod
def calculate_uptime():
current_time = time.time()
uptime = current_time - start_time
if uptim... | 32.714286 | 134 | 0.597525 | from discord.ext.commands import Cog, command, cooldown, BucketType
import time
start_time = time.time()
class Stats(Cog):
def __init__(self, bot):
self.bot = bot
@staticmethod
def calculate_uptime():
current_time = time.time()
uptime = current_time - start_time
if uptim... | true | true |
1c3f5a0a335de8091c3d9ea5a205053cffc9b8b6 | 861 | py | Python | generaImagenTile/test/ph1.py | alffore/tileimagen | baf7321d9e9c002ef8ec10d4c52883ef8e4f18ed | [
"MIT"
] | null | null | null | generaImagenTile/test/ph1.py | alffore/tileimagen | baf7321d9e9c002ef8ec10d4c52883ef8e4f18ed | [
"MIT"
] | null | null | null | generaImagenTile/test/ph1.py | alffore/tileimagen | baf7321d9e9c002ef8ec10d4c52883ef8e4f18ed | [
"MIT"
] | null | null | null | """
Prueba para obtencion de histograma
"""
import sys
import numpy as np
import skimage.color
import skimage.io
import skimage.viewer
from matplotlib import pyplot as plt
# read image, based on command line filename argument;
# read the image as grayscale from the outset
image = skimage.io.imread(fname=sys.argv[1],... | 22.657895 | 58 | 0.710801 | import sys
import numpy as np
import skimage.color
import skimage.io
import skimage.viewer
from matplotlib import pyplot as plt
image = skimage.io.imread(fname=sys.argv[1], as_gray=True)
colors = ("r", "g", "b")
channel_ids = (0, 1, 2)
plt.xlim([0, 256])
for channel_id, c in zip(channel_ids, colors):
... | true | true |
1c3f5c46615ce0f7a4be0e013b2441f34d4bcb1e | 19,070 | py | Python | pylib/gna/env.py | gnafit/gna | c1a58dac11783342c97a2da1b19c97b85bce0394 | [
"MIT"
] | 5 | 2019-10-14T01:06:57.000Z | 2021-02-02T16:33:06.000Z | pylib/gna/env.py | gnafit/gna | c1a58dac11783342c97a2da1b19c97b85bce0394 | [
"MIT"
] | null | null | null | pylib/gna/env.py | gnafit/gna | c1a58dac11783342c97a2da1b19c97b85bce0394 | [
"MIT"
] | null | null | null | from collections import defaultdict, deque, Mapping, OrderedDict
from contextlib import contextmanager
import ROOT
import cppyy
from gna.config import cfg
from . import parameters
provided_precisions = list(map(str, ROOT.GNA.provided_precisions()))
expressionproviders = tuple(ROOT.GNA.GNAObjectTemplates.ExpressionsPro... | 30.857605 | 141 | 0.549816 | from collections import defaultdict, deque, Mapping, OrderedDict
from contextlib import contextmanager
import ROOT
import cppyy
from gna.config import cfg
from . import parameters
provided_precisions = list(map(str, ROOT.GNA.provided_precisions()))
expressionproviders = tuple(ROOT.GNA.GNAObjectTemplates.ExpressionsPro... | true | true |
1c3f5d6c78ec809aa195b52895b4074229d46b61 | 1,644 | py | Python | players/migrations/0001_initial.py | dbisdorf/cortex-roller | 888d4dba8f4f407660b84e12fc8e2ed9874f0b7e | [
"MIT"
] | 5 | 2019-10-14T11:01:00.000Z | 2021-02-08T08:39:35.000Z | players/migrations/0001_initial.py | dbisdorf/cortex-roller | 888d4dba8f4f407660b84e12fc8e2ed9874f0b7e | [
"MIT"
] | 1 | 2022-02-17T22:17:21.000Z | 2022-03-01T14:33:46.000Z | players/migrations/0001_initial.py | dbisdorf/cortex-roller | 888d4dba8f4f407660b84e12fc8e2ed9874f0b7e | [
"MIT"
] | 1 | 2019-10-15T21:17:07.000Z | 2019-10-15T21:17:07.000Z | # Generated by Django 2.1.3 on 2018-11-20 16:25
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Die',
fields=[
('uuid', models.... | 35.73913 | 114 | 0.552311 |
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Die',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, p... | true | true |
1c3f5e1d3a3d9ed47f92c3618cd6b6010f4c812d | 2,589 | py | Python | pikuli/input/helper_types.py | NVoronchev/pikuli | b67e33fa51a7bb7252c5ac11651e2f005542f955 | [
"MIT"
] | null | null | null | pikuli/input/helper_types.py | NVoronchev/pikuli | b67e33fa51a7bb7252c5ac11651e2f005542f955 | [
"MIT"
] | 1 | 2021-05-11T13:40:52.000Z | 2021-05-13T19:42:26.000Z | pikuli/input/helper_types.py | NVoronchev/pikuli | b67e33fa51a7bb7252c5ac11651e2f005542f955 | [
"MIT"
] | 2 | 2021-03-31T14:10:15.000Z | 2022-01-24T02:16:04.000Z | # -*- coding: utf-8 -*-
import os
import traceback
from collections import namedtuple
from pikuli import logger
from pikuli._helpers import NotImplemetedDummyFactory
WindowsButtonCode = namedtuple('WindowsButtonCode', ['event_down', 'event_up'])
class _HookedClassInitMeta(type):
HOOKED_INIT_CLASS_METHODNAME ... | 36.464789 | 112 | 0.68791 |
import os
import traceback
from collections import namedtuple
from pikuli import logger
from pikuli._helpers import NotImplemetedDummyFactory
WindowsButtonCode = namedtuple('WindowsButtonCode', ['event_down', 'event_up'])
class _HookedClassInitMeta(type):
HOOKED_INIT_CLASS_METHODNAME = '__hooked_class_init'... | true | true |
1c3f5fe83b71fe65cd77563bf2e2591a4743c7df | 463 | py | Python | mkt/users/migrations/0003_userprofile_shown_dev_agreement.py | Witia1/zamboni | b1e2d5d475abff2fa5d4990415a06adee33bd647 | [
"BSD-3-Clause"
] | null | null | null | mkt/users/migrations/0003_userprofile_shown_dev_agreement.py | Witia1/zamboni | b1e2d5d475abff2fa5d4990415a06adee33bd647 | [
"BSD-3-Clause"
] | null | null | null | mkt/users/migrations/0003_userprofile_shown_dev_agreement.py | Witia1/zamboni | b1e2d5d475abff2fa5d4990415a06adee33bd647 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0002_auto_20150826_0807'),
]
operations = [
migrations.AddField(
model_name='userprofile',
... | 22.047619 | 62 | 0.617711 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0002_auto_20150826_0807'),
]
operations = [
migrations.AddField(
model_name='userprofile',
name='shown_dev_agreeme... | true | true |
1c3f607124fede9bd7a78b6a7d1b13b66bac75fa | 5,374 | py | Python | croissant/output/base.py | v-legoff/croissant | ec45f530d22d98503182b0dcf635e552c72df831 | [
"BSD-3-Clause"
] | null | null | null | croissant/output/base.py | v-legoff/croissant | ec45f530d22d98503182b0dcf635e552c72df831 | [
"BSD-3-Clause"
] | null | null | null | croissant/output/base.py | v-legoff/croissant | ec45f530d22d98503182b0dcf635e552c72df831 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2013 LE GOFF Vincent
# 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
# list of conditions and th... | 33.798742 | 79 | 0.676219 |
from abc import *
import argparse
import sys
import traceback
from croissant.language.exceptions.syntax import LanguageSyntaxError
from croissant.step.exceptions import *
from croissant.story.story_set import StorySet
class BaseOutput(metaclass=ABCMeta):
def __init__(self):
... | true | true |
1c3f60c2bbe712b82221105cad6428fa3a7f9b19 | 23 | py | Python | proclist/scripts/scythe/proclist/__init__.py | scythe-io/community-modules | bc0d16e30a928f3ba11aecfa6cbac760b1de529b | [
"MIT"
] | 2 | 2022-03-14T18:48:04.000Z | 2022-03-25T14:37:23.000Z | proclist/scripts/scythe/proclist/__init__.py | scythe-io/community-modules | bc0d16e30a928f3ba11aecfa6cbac760b1de529b | [
"MIT"
] | null | null | null | proclist/scripts/scythe/proclist/__init__.py | scythe-io/community-modules | bc0d16e30a928f3ba11aecfa6cbac760b1de529b | [
"MIT"
] | null | null | null | from .proclist import * | 23 | 23 | 0.782609 | from .proclist import * | true | true |
1c3f61758a2bea75a69023c5d49c913db0bf27eb | 4,747 | py | Python | PyOpenGL/GLUT/ex10 - ProjectionMatrix - A MESS/main.py | hoppfull/Legacy-Python | 43f465bfdb76c91f2ac16aabb0783fdf5f459adb | [
"MIT"
] | null | null | null | PyOpenGL/GLUT/ex10 - ProjectionMatrix - A MESS/main.py | hoppfull/Legacy-Python | 43f465bfdb76c91f2ac16aabb0783fdf5f459adb | [
"MIT"
] | null | null | null | PyOpenGL/GLUT/ex10 - ProjectionMatrix - A MESS/main.py | hoppfull/Legacy-Python | 43f465bfdb76c91f2ac16aabb0783fdf5f459adb | [
"MIT"
] | null | null | null | import utils_engine, utils_math, utils_resource
import OpenGL.GL as GL
import OpenGL.GL.shaders as GL_shaders
import numpy as np
import ctypes as c
class MyApp(utils_engine.GameEngine):
def __init__(self, name, width, height):
utils_engine.GameEngine.__init__(self, name, width, height)
def set... | 43.154545 | 139 | 0.552138 | import utils_engine, utils_math, utils_resource
import OpenGL.GL as GL
import OpenGL.GL.shaders as GL_shaders
import numpy as np
import ctypes as c
class MyApp(utils_engine.GameEngine):
def __init__(self, name, width, height):
utils_engine.GameEngine.__init__(self, name, width, height)
def set... | true | true |
1c3f62843467a28fb77274068f50cff3e0fe7d6f | 7,400 | py | Python | Botnets/Scanning/TELNET/PY BRUTER/op.py | 1ucif3r/DDOS-th31ucif3r | b5f6db19ea25ed3ceca71862eaae58c184270fdd | [
"MIT"
] | 1 | 2021-09-22T13:11:00.000Z | 2021-09-22T13:11:00.000Z | Botnets/Scanning/TELNET/PY BRUTER/op.py | 1ucif3r/DDOS-th31ucif3r | b5f6db19ea25ed3ceca71862eaae58c184270fdd | [
"MIT"
] | null | null | null | Botnets/Scanning/TELNET/PY BRUTER/op.py | 1ucif3r/DDOS-th31ucif3r | b5f6db19ea25ed3ceca71862eaae58c184270fdd | [
"MIT"
] | 3 | 2021-06-27T00:20:17.000Z | 2022-02-26T09:11:03.000Z | #!/usr/bin/python
import threading
import sys, os, re, time, socket, select
from Queue import *
from sys import stdout
if len(sys.argv) < 4:
print "Usage: python "+sys.argv[0]+" <list> <threads> <output file>"
sys.exit()
wget = "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://185.... | 33.035714 | 280 | 0.437162 |
import threading
import sys, os, re, time, socket, select
from Queue import *
from sys import stdout
if len(sys.argv) < 4:
print "Usage: python "+sys.argv[0]+" <list> <threads> <output file>"
sys.exit()
wget = "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://185.10.68.196/update.s... | false | true |
1c3f645e30bcabf29bc1edf77a2662965cc28fd6 | 655 | py | Python | functional_tests/factory/__init__.py | vindeolal/pari | 8c69d15101480c3e803d6d74f8007cefee20c350 | [
"BSD-3-Clause"
] | null | null | null | functional_tests/factory/__init__.py | vindeolal/pari | 8c69d15101480c3e803d6d74f8007cefee20c350 | [
"BSD-3-Clause"
] | null | null | null | functional_tests/factory/__init__.py | vindeolal/pari | 8c69d15101480c3e803d6d74f8007cefee20c350 | [
"BSD-3-Clause"
] | null | null | null | from author_factory import AuthorFactory
from page_factory import PageFactory
from page_factory import ContentTypeFactory
from home_page_factory import HomePageFactory
from article_factory import ArticleFactory
from category_factory import CategoryFactory
from location_factory import LocationFactory
from album_factory ... | 43.666667 | 60 | 0.90687 | from author_factory import AuthorFactory
from page_factory import PageFactory
from page_factory import ContentTypeFactory
from home_page_factory import HomePageFactory
from article_factory import ArticleFactory
from category_factory import CategoryFactory
from location_factory import LocationFactory
from album_factory ... | true | true |
1c3f66e91094f62aa9f4d2795bd6a5c95d2780dd | 381 | py | Python | 1f_http_server/python/fastapi_srv.py | pjuangph/python2rust | cc99abe8738e5d1d7d9a34debb2892186ff77965 | [
"CC0-1.0"
] | 24 | 2021-07-09T13:56:45.000Z | 2022-03-26T19:44:00.000Z | 1f_http_server/python/fastapi_srv.py | pjuangph/python2rust | cc99abe8738e5d1d7d9a34debb2892186ff77965 | [
"CC0-1.0"
] | null | null | null | 1f_http_server/python/fastapi_srv.py | pjuangph/python2rust | cc99abe8738e5d1d7d9a34debb2892186ff77965 | [
"CC0-1.0"
] | 3 | 2021-07-09T17:16:31.000Z | 2022-03-24T15:44:44.000Z | from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
app = FastAPI()
app.mount("/static", StaticFiles(directory="../static"), name="static")
@app.get("/")
@app.get("/hello/{name}")
async def root(name: str = "World"):
return {"message": f"Hello, {name}!"}
@app.get("/items/{item_id}")
async ... | 21.166667 | 71 | 0.671916 | from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
app = FastAPI()
app.mount("/static", StaticFiles(directory="../static"), name="static")
@app.get("/")
@app.get("/hello/{name}")
async def root(name: str = "World"):
return {"message": f"Hello, {name}!"}
@app.get("/items/{item_id}")
async ... | true | true |
1c3f6817d7d24807136393dde05bea0604f29c9c | 18,102 | py | Python | tests/test_isoparser.py | cccntu/dateutil | 86ab39008e6eddce2b0837553d9ff42aee25c783 | [
"Apache-2.0"
] | null | null | null | tests/test_isoparser.py | cccntu/dateutil | 86ab39008e6eddce2b0837553d9ff42aee25c783 | [
"Apache-2.0"
] | null | null | null | tests/test_isoparser.py | cccntu/dateutil | 86ab39008e6eddce2b0837553d9ff42aee25c783 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime, timedelta, date, time
import itertools as it
from bs_dateutil import tz
from bs_dateutil.tz import UTC
from bs_dateutil.parser import isoparser, isoparse
import pytest
import six
def _generate_tzoffsets(limited):
def... | 30.270903 | 88 | 0.610872 |
from __future__ import unicode_literals
from datetime import datetime, timedelta, date, time
import itertools as it
from bs_dateutil import tz
from bs_dateutil.tz import UTC
from bs_dateutil.parser import isoparser, isoparse
import pytest
import six
def _generate_tzoffsets(limited):
def _mkoffset(hmtuple, fmt... | true | true |
1c3f6935c2fe92c6a0e7e7de5c115dad5830b9da | 1,414 | py | Python | examples/resnet_app.py | yaoxuefeng6/FleetX | 4e1a77789b76eccc20154a7e2ad2b120ffc512c4 | [
"Apache-2.0"
] | null | null | null | examples/resnet_app.py | yaoxuefeng6/FleetX | 4e1a77789b76eccc20154a7e2ad2b120ffc512c4 | [
"Apache-2.0"
] | null | null | null | examples/resnet_app.py | yaoxuefeng6/FleetX | 4e1a77789b76eccc20154a7e2ad2b120ffc512c4 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.25641 | 74 | 0.7843 |
import fleetx as X
import paddle
import paddle.distributed.fleet as fleet
configs = X.parse_train_configs()
fleet.init(is_collective=True)
model = X.applications.Resnet50()
imagenet_downloader = X.utils.ImageNetDownloader()
local_path = imagenet_downloader.download_from_bos(local_path='./data')
loader = ... | true | true |
1c3f693af9e7d5604a693ebf041c5169a43922a3 | 12,733 | py | Python | sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py | detienne20/azure-sdk-for-python | f3522cd897ca6adf113b1a1204a2627d8ba76a6b | [
"MIT"
] | null | null | null | sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py | detienne20/azure-sdk-for-python | f3522cd897ca6adf113b1a1204a2627d8ba76a6b | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py | detienne20/azure-sdk-for-python | f3522cd897ca6adf113b1a1204a2627d8ba76a6b | [
"MIT"
] | 1 | 2020-07-05T21:13:37.000Z | 2020-07-05T21:13:37.000Z | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import pytest
import functools
from io import BytesIO
from azure.core.exceptions import ServiceRequestError, ClientAuthenticationError, HttpResponseError... | 41.074194 | 130 | 0.693317 |
import pytest
import functools
from io import BytesIO
from azure.core.exceptions import ServiceRequestError, ClientAuthenticationError, HttpResponseError
from azure.core.credentials import AzureKeyCredential
from azure.ai.formrecognizer._generated.models import AnalyzeOperationResult
from azure.ai.formrecognizer.... | true | true |
1c3f6a5f08afd75c67f920ff05c9b729750be194 | 35 | py | Python | TechAdoption/__init__.py | Epeiffer1/TechAdoption | 54dcdf95ba19699f6fc901e92551fb71557d2f23 | [
"MIT"
] | 15 | 2021-08-05T17:58:38.000Z | 2022-03-29T22:16:37.000Z | TechAdoption/__init__.py | Epeiffer1/TechAdoption | 54dcdf95ba19699f6fc901e92551fb71557d2f23 | [
"MIT"
] | null | null | null | TechAdoption/__init__.py | Epeiffer1/TechAdoption | 54dcdf95ba19699f6fc901e92551fb71557d2f23 | [
"MIT"
] | 1 | 2020-06-12T18:07:52.000Z | 2020-06-12T18:07:52.000Z | # Dummy file to make this a package | 35 | 35 | 0.771429 | true | true | |
1c3f6ad824ec4cf4650b2b94fd15be8fa9305a23 | 21,915 | py | Python | dist_filter_torch.py | ShansanChu/filter_pruning_fpgm | ea24a5a8aaa2642937a7655eddb5b0c8c8328d3f | [
"MIT"
] | 4 | 2021-02-01T15:08:09.000Z | 2021-07-15T08:47:33.000Z | dist_filter_torch.py | ShansanChu/filter_pruning_fpgm | ea24a5a8aaa2642937a7655eddb5b0c8c8328d3f | [
"MIT"
] | null | null | null | dist_filter_torch.py | ShansanChu/filter_pruning_fpgm | ea24a5a8aaa2642937a7655eddb5b0c8c8328d3f | [
"MIT"
] | 2 | 2021-01-11T12:54:44.000Z | 2021-01-17T13:01:32.000Z | '''
filter pruners with FPGM
'''
import argparse
import os
import json
import torch
import sys
import numpy as np
import torch.nn.parallel
import torch.utils.data.distributed
from torch.optim.lr_scheduler import StepLR, MultiStepLR
from torchvision import datasets, transforms
import time
from models.mnist.lenet import... | 43.310277 | 145 | 0.630116 |
import argparse
import os
import json
import torch
import sys
import numpy as np
import torch.nn.parallel
import torch.utils.data.distributed
from torch.optim.lr_scheduler import StepLR, MultiStepLR
from torchvision import datasets, transforms
import time
from models.mnist.lenet import LeNet
from models.cifar10.vgg im... | true | true |
1c3f6b75a0f5defb105eb5e2aee525e5912bf9b8 | 35,124 | py | Python | pytrx/async_tron.py | Connor-Holmes/PyTRX | 7d129f27a6e87c1f1bdad93a7ae9503390b2ec70 | [
"MIT"
] | null | null | null | pytrx/async_tron.py | Connor-Holmes/PyTRX | 7d129f27a6e87c1f1bdad93a7ae9503390b2ec70 | [
"MIT"
] | null | null | null | pytrx/async_tron.py | Connor-Holmes/PyTRX | 7d129f27a6e87c1f1bdad93a7ae9503390b2ec70 | [
"MIT"
] | null | null | null | from typing import Union, Tuple, Optional
import asyncio
from typing import Union, Tuple
import time
from pprint import pprint
import json
from decimal import Decimal
from pytrx import keys
from pytrx.async_contract import AsyncContract, ShieldedTRC20, AsyncContractMethod
from pytrx.keys import PrivateKey
from pytrx.a... | 38.428884 | 120 | 0.607875 | from typing import Union, Tuple, Optional
import asyncio
from typing import Union, Tuple
import time
from pprint import pprint
import json
from decimal import Decimal
from pytrx import keys
from pytrx.async_contract import AsyncContract, ShieldedTRC20, AsyncContractMethod
from pytrx.keys import PrivateKey
from pytrx.a... | true | true |
1c3f6d28293ce3580e61d89bb0ac676e5899d742 | 1,247 | py | Python | conanfile.py | jkleinecke/util | 8dab223de686e15165b11e56deabdc21d0f063ab | [
"MIT"
] | null | null | null | conanfile.py | jkleinecke/util | 8dab223de686e15165b11e56deabdc21d0f063ab | [
"MIT"
] | null | null | null | conanfile.py | jkleinecke/util | 8dab223de686e15165b11e56deabdc21d0f063ab | [
"MIT"
] | null | null | null | from conans import ConanFile, CMake, tools
import os
class UtilConan(ConanFile):
name = "util"
version = "0.1"
license = "<Put the package license here>"
url = "<Package recipe repository url here, for issues about the package>"
settings = "os", "compiler", "build_type", "arch"
generators = "c... | 34.638889 | 91 | 0.588613 | from conans import ConanFile, CMake, tools
import os
class UtilConan(ConanFile):
name = "util"
version = "0.1"
license = "<Put the package license here>"
url = "<Package recipe repository url here, for issues about the package>"
settings = "os", "compiler", "build_type", "arch"
generators = "c... | true | true |
1c3f6f00a36362626b78c0c97b85523d99e1c6cc | 3,042 | py | Python | corehq/messaging/smsbackends/apposit/models.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | corehq/messaging/smsbackends/apposit/models.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 94 | 2020-12-11T06:57:31.000Z | 2022-03-15T10:24:06.000Z | corehq/messaging/smsbackends/apposit/models.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | null | null | null | import json
import requests
from corehq.apps.sms.models import SMS, SQLSMSBackend
from corehq.apps.sms.util import strip_plus
from corehq.messaging.smsbackends.apposit.forms import AppositBackendForm
from django.conf import settings
ETHIOPIA_COUNTRY_CODE = '251'
class AppositException(Exception):
pass
class S... | 28.971429 | 114 | 0.636752 | import json
import requests
from corehq.apps.sms.models import SMS, SQLSMSBackend
from corehq.apps.sms.util import strip_plus
from corehq.messaging.smsbackends.apposit.forms import AppositBackendForm
from django.conf import settings
ETHIOPIA_COUNTRY_CODE = '251'
class AppositException(Exception):
pass
class S... | true | true |
1c3f6f55e0cfc68d9078c041efbc80f1919db067 | 924 | py | Python | apis/nb/clients/network_plug_and_play_client/models/ZtdDefaultImageListResult.py | CiscoDevNet/APIC-EM-Generic-Scripts- | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 45 | 2016-06-09T15:41:25.000Z | 2019-08-06T17:13:11.000Z | apis/nb/clients/network_plug_and_play_client/models/ZtdDefaultImageListResult.py | CiscoDevNet/APIC-EM-Generic-Scripts | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 36 | 2016-06-12T03:03:56.000Z | 2017-03-13T18:20:11.000Z | apis/nb/clients/network_plug_and_play_client/models/ZtdDefaultImageListResult.py | CiscoDevNet/APIC-EM-Generic-Scripts | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2016-06-22T03:51:37.000Z | 2019-07-10T10:06:02.000Z | #!/usr/bin/env python
#pylint: skip-file
# This source code is licensed under the Apache license found in the
# LICENSE file in the root directory of this project.
class ZtdDefaultImageListResult(object):
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute nam... | 23.1 | 97 | 0.50974 |
class ZtdDefaultImageListResult(object):
def __init__(self):
self.swaggerTypes = {
'version': 'str',
'response': 'list[ZtdDefaultImage]'
}
self.attributeMap = {
'version': 'version',... | true | true |
1c3f6f7dd3a5fc91947f13b25f2556617e624240 | 2,433 | py | Python | linky_note/adapters/markdown/marko_ext/marko_builder.py | jb-delafosse/linky-note | 51249414531bab98e45465aab695285698d59d80 | [
"MIT"
] | 14 | 2021-02-26T16:21:02.000Z | 2022-01-17T20:30:40.000Z | linky_note/adapters/markdown/marko_ext/marko_builder.py | jb-delafosse/linky-note | 51249414531bab98e45465aab695285698d59d80 | [
"MIT"
] | 76 | 2021-02-25T06:34:58.000Z | 2022-03-30T19:06:26.000Z | linky_note/adapters/markdown/marko_ext/marko_builder.py | jb-delafosse/marko-backlinks | e7798ed49874a784b71e2a2a0ce0a1e7a1204389 | [
"MIT"
] | null | null | null | from typing import List, Optional, Union
from marko.block import BlankLine, Heading
from marko.block import List as MdList
from marko.block import ListItem, Paragraph
from marko.inline import Link, RawText
class MarkoBuilder:
@staticmethod
def build_raw_element(label: str) -> RawText:
raw_text = obje... | 31.192308 | 78 | 0.64776 | from typing import List, Optional, Union
from marko.block import BlankLine, Heading
from marko.block import List as MdList
from marko.block import ListItem, Paragraph
from marko.inline import Link, RawText
class MarkoBuilder:
@staticmethod
def build_raw_element(label: str) -> RawText:
raw_text = obje... | true | true |
1c3f70d650130584622f48491aba3dd16d3a1053 | 3,873 | py | Python | paper/notebooks/util/kfac.py | npshub/last_layer_laplace | 31ec9b70a292e9783e9005425793199a8830bf01 | [
"BSD-3-Clause"
] | 60 | 2020-07-05T05:31:19.000Z | 2022-02-07T05:05:40.000Z | paper/notebooks/util/kfac.py | npshub/last_layer_laplace | 31ec9b70a292e9783e9005425793199a8830bf01 | [
"BSD-3-Clause"
] | 8 | 2020-07-15T18:27:53.000Z | 2021-10-18T07:53:22.000Z | paper/notebooks/util/kfac.py | npshub/last_layer_laplace | 31ec9b70a292e9783e9005425793199a8830bf01 | [
"BSD-3-Clause"
] | 12 | 2020-07-14T11:44:10.000Z | 2021-11-06T03:10:15.000Z | ##########################################################################
#
# Taken with modifications from
# https://github.com/wjmaddox/swa_gaussian/
#
##########################################################################
import torch
import torch.nn.functional as F
from torch.optim.optimizer import Optimi... | 33.678261 | 77 | 0.506584 | true | true | |
1c3f7124803e580cd7296463519e07f704c99418 | 1,728 | py | Python | anchore_engine/subsys/discovery.py | roachmd/anchore-engine | 521d6796778139a95f51542670714205c2735a81 | [
"Apache-2.0"
] | null | null | null | anchore_engine/subsys/discovery.py | roachmd/anchore-engine | 521d6796778139a95f51542670714205c2735a81 | [
"Apache-2.0"
] | null | null | null | anchore_engine/subsys/discovery.py | roachmd/anchore-engine | 521d6796778139a95f51542670714205c2735a81 | [
"Apache-2.0"
] | null | null | null | """
Utilities for service discovery. Basic methods are lookup and return of a list of endpoints given a service name.
Will use the local config as authority if entry is found or defer to the database for a lookup if necessary.
"""
import re
from anchore_engine.configuration import localconfig
from anchore_engine.db i... | 38.4 | 117 | 0.624421 |
import re
from anchore_engine.configuration import localconfig
from anchore_engine.db import db_services, session_scope
from anchore_engine.subsys import logger
def get_endpoints(service_name):
local_conf = localconfig.get_config()
urls = []
try:
if service_name + '_endpoint' in local_conf:
... | true | true |
1c3f7196de24de8454c0187dbe0a0fbd829d34ed | 630 | py | Python | setup.py | hsph/micropython-ili9341 | 1924159a32cf685812bd372d02b4ec2cb9c8e381 | [
"MIT"
] | null | null | null | setup.py | hsph/micropython-ili9341 | 1924159a32cf685812bd372d02b4ec2cb9c8e381 | [
"MIT"
] | null | null | null | setup.py | hsph/micropython-ili9341 | 1924159a32cf685812bd372d02b4ec2cb9c8e381 | [
"MIT"
] | null | null | null | import sys
sys.path.pop(0)
from setuptools import setup
setup(
name="micropython-ili9341",
py_modules=["ili934xnew"],
version="0.1.0",
description="Micropython Driver for ILI9341 display",
long_description="",
keywords="micropython tft lcd",
url="https://github.com/jeffmer/micropython-ili93... | 26.25 | 74 | 0.644444 | import sys
sys.path.pop(0)
from setuptools import setup
setup(
name="micropython-ili9341",
py_modules=["ili934xnew"],
version="0.1.0",
description="Micropython Driver for ILI9341 display",
long_description="",
keywords="micropython tft lcd",
url="https://github.com/jeffmer/micropython-ili93... | true | true |
1c3f7306637cd8a61fde0fb2b8d72c8f272b725a | 4,680 | py | Python | tasks/cron.py | jeeysie/site | f136050635cac9cc0174387ea60249f5e26e45a3 | [
"MIT"
] | 66 | 2019-05-13T11:45:14.000Z | 2020-11-02T11:58:52.000Z | tasks/cron.py | jeeysie/site | f136050635cac9cc0174387ea60249f5e26e45a3 | [
"MIT"
] | 9 | 2019-04-26T02:05:13.000Z | 2020-10-06T03:49:29.000Z | tasks/cron.py | jeeyshe/site | f136050635cac9cc0174387ea60249f5e26e45a3 | [
"MIT"
] | 20 | 2019-12-30T06:23:17.000Z | 2020-10-06T01:48:58.000Z | # coding: utf-8
"""
Created by Jeyrce.Lu 2020/4/4 下午5:16, contact with jeyrce@gmail.com or website https://www.lujianxin.com
---------------------------------------------------------------------------------------------------------
>>> 项目中的一些定时任务
"""
import logging
import datetime
import time
from django.core.mail impo... | 32.5 | 112 | 0.562179 |
import logging
import datetime
import time
from django.core.mail import send_mail
from django.core.cache import caches
from django.contrib.auth import get_user_model
from django.template import loader
from tasks import app
from blog.models import Expand, Blog, Link
from tasks.mail import add_prefix, supervisor_recei... | true | true |
1c3f74c3c64a04ce73e6cd9f4b7d8a0af43690df | 3,035 | py | Python | 18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/form/form/settings.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 3 | 2020-06-01T04:17:18.000Z | 2020-12-18T03:05:55.000Z | 18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/form/form/settings.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 1 | 2020-04-25T08:01:59.000Z | 2020-04-25T08:01:59.000Z | 18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/form/form/settings.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 7 | 2020-04-26T10:02:36.000Z | 2021-06-08T05:12:46.000Z | # Scrapy settings for form project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-middleware.ht... | 34.101124 | 103 | 0.774629 |
BOT_NAME = 'form'
SPIDER_MODULES = ['form.spiders']
NEWSPIDER_MODULE = 'form.spiders'
ROBOTSTXT_OBEY = True
| true | true |
1c3f76c215b4fd57915de3ea39d046dee571fc8d | 859 | py | Python | LeetCode/0695. Max Area of Island/solution.py | InnoFang/oh-my-algorithms | f559dba371ce725a926725ad28d5e1c2facd0ab2 | [
"Apache-2.0"
] | 1 | 2017-03-31T15:24:01.000Z | 2017-03-31T15:24:01.000Z | LeetCode/0695. Max Area of Island/solution.py | InnoFang/Algorithm-Library | 1896b9d8b1fa4cd73879aaecf97bc32d13ae0169 | [
"Apache-2.0"
] | null | null | null | LeetCode/0695. Max Area of Island/solution.py | InnoFang/Algorithm-Library | 1896b9d8b1fa4cd73879aaecf97bc32d13ae0169 | [
"Apache-2.0"
] | null | null | null | """
728 / 728 test cases passed.
Runtime: 64 ms
Memory Usage: 15.3 MB
"""
class Solution:
def maxAreaOfIsland(self, grid: List[List[int]]) -> int:
ans, m, n = 0, len(grid), len(grid[0])
for i in range(m):
for j in range(n):
if grid[i][j] == 1:
que = co... | 35.791667 | 87 | 0.351572 | class Solution:
def maxAreaOfIsland(self, grid: List[List[int]]) -> int:
ans, m, n = 0, len(grid), len(grid[0])
for i in range(m):
for j in range(n):
if grid[i][j] == 1:
que = collections.deque([(i, j)])
grid[i][j] = 0
... | true | true |
1c3f784e25e1d1d8e3ba8a230dd11355ebb201ce | 52,836 | py | Python | second/pytorch/models/middle.py | robertkarklinsh/faster-more-furious | 2a5e34f829488acfa6fec84d800f409d590bd03c | [
"MIT"
] | 1 | 2019-05-20T03:43:18.000Z | 2019-05-20T03:43:18.000Z | second/pytorch/models/middle.py | pflab-ut/second.pytorch | c7bb659a7937ee62aef8049aeb055a457fcd8fa7 | [
"MIT"
] | null | null | null | second/pytorch/models/middle.py | pflab-ut/second.pytorch | c7bb659a7937ee62aef8049aeb055a457fcd8fa7 | [
"MIT"
] | null | null | null | import time
import numpy as np
import spconv
import torch
from torch import nn
from torch.nn import functional as F
from second.pytorch.models.resnet import SparseBasicBlock
from torchplus.nn import Empty, GroupNorm, Sequential
from torchplus.ops.array_ops import gather_nd, scatter_nd
from torchplus.tools import chan... | 39.577528 | 100 | 0.521557 | import time
import numpy as np
import spconv
import torch
from torch import nn
from torch.nn import functional as F
from second.pytorch.models.resnet import SparseBasicBlock
from torchplus.nn import Empty, GroupNorm, Sequential
from torchplus.ops.array_ops import gather_nd, scatter_nd
from torchplus.tools import chan... | true | true |
1c3f78da7320a443287010f3c5804dafaf315c80 | 11,094 | py | Python | pymatgen/io/tests/test_zeopp.py | Chessmag/pymatgen | 61a4bb7a1792e1ea2379abd45b3c40efb816fd64 | [
"MIT"
] | 1 | 2021-10-18T01:26:50.000Z | 2021-10-18T01:26:50.000Z | pymatgen/io/tests/test_zeopp.py | Chessmag/pymatgen | 61a4bb7a1792e1ea2379abd45b3c40efb816fd64 | [
"MIT"
] | null | null | null | pymatgen/io/tests/test_zeopp.py | Chessmag/pymatgen | 61a4bb7a1792e1ea2379abd45b3c40efb816fd64 | [
"MIT"
] | null | null | null | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
__author__ = "Bharat Medasani"
__copyright__ = "Copyright 2013, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "bkmedasani@lbl.gov"
__date__ = "Aug 2, 2013"
import un... | 39.06338 | 79 | 0.651343 |
__author__ = "Bharat Medasani"
__copyright__ = "Copyright 2013, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "bkmedasani@lbl.gov"
__date__ = "Aug 2, 2013"
import unittest
import os
import re
from pymatgen.core.periodic_table import Species
from pymatgen.core.structure ... | true | true |
1c3f78dc4aece1154c664c043608f541804aea3a | 100,943 | py | Python | nltk/featstruct.py | tousif/nltk-gae | 9181f8991d0566e693f82d0bb0479219c3fc8768 | [
"Apache-2.0"
] | 3 | 2017-03-07T10:54:56.000Z | 2019-10-18T20:36:56.000Z | nltk/featstruct.py | tousif/nltk-gae | 9181f8991d0566e693f82d0bb0479219c3fc8768 | [
"Apache-2.0"
] | null | null | null | nltk/featstruct.py | tousif/nltk-gae | 9181f8991d0566e693f82d0bb0479219c3fc8768 | [
"Apache-2.0"
] | null | null | null | # Natural Language Toolkit: Feature Structures
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>,
# Rob Speer,
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sourceforge.net>
# For license information, see LICENSE.TXT
"""
Basic data classes for... | 41.03374 | 118 | 0.58963 |
"""
Basic data classes for representing feature structures, and for
performing basic operations on those feature structures. A feature
structure is a mapping from feature identifiers to feature values,
where each feature value is either a basic value (such as a string or
an integer), or a nested feature struc... | false | true |
1c3f796b9f5638396fc79a7e1e9a7954890167dc | 523 | py | Python | tests/conftest.py | erlep/PyTest | 5524c2d684ee47ce75f76cf828c755cda23df73c | [
"MIT"
] | null | null | null | tests/conftest.py | erlep/PyTest | 5524c2d684ee47ce75f76cf828c755cda23df73c | [
"MIT"
] | null | null | null | tests/conftest.py | erlep/PyTest | 5524c2d684ee47ce75f76cf828c755cda23df73c | [
"MIT"
] | null | null | null | # In pytest, what is the use of conftest.py files? - https://bit.ly/3EVB7yn
import pytest
import sys
@pytest.fixture
def capture_stdout(monkeypatch):
buffer = {"stdout": "", "write_calls": 0}
def fake_write(s):
buffer["stdout"] += s
buffer["write_calls"] += 1
monkeypatch.setattr(sys.stdout, 'write', ... | 20.92 | 86 | 0.674952 |
import pytest
import sys
@pytest.fixture
def capture_stdout(monkeypatch):
buffer = {"stdout": "", "write_calls": 0}
def fake_write(s):
buffer["stdout"] += s
buffer["write_calls"] += 1
monkeypatch.setattr(sys.stdout, 'write', fake_write)
return buffer
@pytest.fixture(scope="session")
def db_conn(... | true | true |
1c3f79f859edbcb9220e7e3ffe94558764672e95 | 762 | py | Python | bokeh_app/data/synthetic_data_generator.py | goodteamname/spino | aa8c6cfa9f94a639c306d85ca6df2483108fda37 | [
"MIT"
] | null | null | null | bokeh_app/data/synthetic_data_generator.py | goodteamname/spino | aa8c6cfa9f94a639c306d85ca6df2483108fda37 | [
"MIT"
] | 9 | 2020-10-26T10:57:00.000Z | 2020-11-01T14:48:21.000Z | bokeh_app/data/synthetic_data_generator.py | goodteamname/spino | aa8c6cfa9f94a639c306d85ca6df2483108fda37 | [
"MIT"
] | 1 | 2020-10-26T10:41:31.000Z | 2020-10-26T10:41:31.000Z | import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(0, 20, 1001)
noise = np.random.randn(1001)
T = np.pi # period
# Fourier series coefficients
a_0 = 1.
a_1 = 1.
a_2 = 2.
a_3 = 3.
b_1 = 4.
b_2 = 5.
b_3 = 6.
timeseries = a_0 \
+ a_1*np.cos(1*np.pi*t/T) \
+ a_2*np.cos(2*np.pi*t/T) \
+ a_... | 19.538462 | 68 | 0.635171 | import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(0, 20, 1001)
noise = np.random.randn(1001)
T = np.pi
a_0 = 1.
a_1 = 1.
a_2 = 2.
a_3 = 3.
b_1 = 4.
b_2 = 5.
b_3 = 6.
timeseries = a_0 \
+ a_1*np.cos(1*np.pi*t/T) \
+ a_2*np.cos(2*np.pi*t/T) \
+ a_3*np.cos(3*np.pi*t/T) \
+ b_1*np.... | true | true |
1c3f7a392ac2a8f3459f0a2fa8a65f80aba96efe | 285 | py | Python | renovation_logging/config/desktop.py | leam-tech/renovation_logging | 172be47b9b5f7a49590efcda3cf189687e514069 | [
"MIT"
] | 1 | 2021-06-19T12:10:12.000Z | 2021-06-19T12:10:12.000Z | renovation_logging/config/desktop.py | leam-tech/renovation_logging | 172be47b9b5f7a49590efcda3cf189687e514069 | [
"MIT"
] | null | null | null | renovation_logging/config/desktop.py | leam-tech/renovation_logging | 172be47b9b5f7a49590efcda3cf189687e514069 | [
"MIT"
] | 1 | 2021-06-19T12:10:15.000Z | 2021-06-19T12:10:15.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Renovation Logging",
"color": "grey",
"icon": "octicon octicon-file-directory",
"type": "module",
"label": _("Renovation Logging")
}
]
| 19 | 44 | 0.635088 |
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Renovation Logging",
"color": "grey",
"icon": "octicon octicon-file-directory",
"type": "module",
"label": _("Renovation Logging")
}
]
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.