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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7182d6e6d3b349d21daf564822adcc7676043c2 | 763 | py | Python | osmaxx/contrib/auth/migrations/0005_auto_20170511_1100.py | tyrasd/osmaxx | da4454083d17b2ef8b0623cad62e39992b6bd52a | [
"MIT"
] | 27 | 2015-03-30T14:17:26.000Z | 2022-02-19T17:30:44.000Z | osmaxx/contrib/auth/migrations/0005_auto_20170511_1100.py | tyrasd/osmaxx | da4454083d17b2ef8b0623cad62e39992b6bd52a | [
"MIT"
] | 483 | 2015-03-09T16:58:03.000Z | 2022-03-14T09:29:06.000Z | osmaxx/contrib/auth/migrations/0005_auto_20170511_1100.py | tyrasd/osmaxx | da4454083d17b2ef8b0623cad62e39992b6bd52a | [
"MIT"
] | 6 | 2015-04-07T07:38:30.000Z | 2020-04-01T12:45:53.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-11 09:00
from __future__ import unicode_literals
import django.contrib.auth.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auth', '0004_add_high_priority_user_group'),
]
... | 34.681818 | 317 | 0.684142 | from __future__ import unicode_literals
import django.contrib.auth.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auth', '0004_add_high_priority_user_group'),
]
operations = [
migrations.AlterField(
model_name='u... | true | true |
f7182d8eab34c12e2650f3389e5bc285665ac5d6 | 82 | py | Python | PyRacing2/gym_race/envs/__init__.py | CeVauDe/bugfree-game-about-bugs | ff1b3e07188fca1775fcc1ce95b59b188c29cee2 | [
"MIT"
] | null | null | null | PyRacing2/gym_race/envs/__init__.py | CeVauDe/bugfree-game-about-bugs | ff1b3e07188fca1775fcc1ce95b59b188c29cee2 | [
"MIT"
] | 3 | 2021-07-09T21:32:37.000Z | 2021-07-09T21:55:02.000Z | PyRacing2/gym_race/envs/__init__.py | CeVauDe/bugfree-game-about-bugs | ff1b3e07188fca1775fcc1ce95b59b188c29cee2 | [
"MIT"
] | null | null | null | from gym_race.envs.race_env import *
from gym_race.envs.pyrace_2d import PyRace2D
| 27.333333 | 44 | 0.841463 | from gym_race.envs.race_env import *
from gym_race.envs.pyrace_2d import PyRace2D
| true | true |
f7182d96424929dbe947667e2add89639bbe42ee | 2,472 | py | Python | markwiki/util.py | cabalamat/markwiki | 7c18c3c52eee51ee4544eceee570db6b63782152 | [
"BSD-2-Clause"
] | 1 | 2019-09-18T12:05:44.000Z | 2019-09-18T12:05:44.000Z | markwiki/util.py | cabalamat/markwiki | 7c18c3c52eee51ee4544eceee570db6b63782152 | [
"BSD-2-Clause"
] | null | null | null | markwiki/util.py | cabalamat/markwiki | 7c18c3c52eee51ee4544eceee570db6b63782152 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2016, Matt Layman
'''The junk drawer. A place for methods that don't logically fit elsewhere.'''
import os
import random
import shutil
import string
import sys
from werkzeug import security
from markwiki.models.user import User
def boolify(value):
'''Check the string value for boolean-like beha... | 35.314286 | 79 | 0.678803 |
import os
import random
import shutil
import string
import sys
from werkzeug import security
from markwiki.models.user import User
def boolify(value):
return value.lower().startswith('t')
def bootstrap(app):
here = os.path.abspath(os.path.dirname(__file__))
wiki_path = app.config['WIKI_PATH']
... | true | true |
f7182f57d6af96c12b32a662d6d180925830beae | 398 | py | Python | server/urbanity/wsgi.py | zoek1/urbanity | 33fef559645183c76527df2d7982dee5fcde28f7 | [
"MIT"
] | null | null | null | server/urbanity/wsgi.py | zoek1/urbanity | 33fef559645183c76527df2d7982dee5fcde28f7 | [
"MIT"
] | null | null | null | server/urbanity/wsgi.py | zoek1/urbanity | 33fef559645183c76527df2d7982dee5fcde28f7 | [
"MIT"
] | null | null | null | """
WSGI config for firey_server project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... | 23.411765 | 78 | 0.788945 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "urbanity.settings")
application = get_wsgi_application()
| true | true |
f71834accc3ef2b84d9e02493e984df9c647ca15 | 12,864 | py | Python | make_cv.py | toritamantaro/yaml_cv_py | 40bc07b90873bb47aad08975495c2c52e2e0e1cd | [
"MIT"
] | 10 | 2018-09-05T15:34:21.000Z | 2021-02-11T05:15:34.000Z | make_cv.py | toritamantaro/yaml_cv_py | 40bc07b90873bb47aad08975495c2c52e2e0e1cd | [
"MIT"
] | 2 | 2021-03-18T08:14:09.000Z | 2021-04-22T04:26:27.000Z | make_cv.py | toritamantaro/yaml_cv_py | 40bc07b90873bb47aad08975495c2c52e2e0e1cd | [
"MIT"
] | 1 | 2020-06-15T23:58:02.000Z | 2020-06-15T23:58:02.000Z | # -*- coding: utf-8 -*-
from typing import Dict, Tuple, Any, Optional
import re
import string
import ast
import codecs
import argparse
import yaml
from reportlab.pdfgen import canvas
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.cidfonts import UnicodeCIDFont
from reportlab.pdfbase.ttfonts import TT... | 36.965517 | 111 | 0.569108 |
from typing import Dict, Tuple, Any, Optional
import re
import string
import ast
import codecs
import argparse
import yaml
from reportlab.pdfgen import canvas
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.cidfonts import UnicodeCIDFont
from reportlab.pdfbase.ttfonts import TTFont, TTFError
from repo... | true | true |
f71835403421c46fd7d2e1a64c97d3ad46ed7a63 | 691 | py | Python | docker_registry/storage/__init__.py | kirat-singh/docker-registry | ca53d728fb57302606892362820dfaa8aed105c5 | [
"Apache-2.0"
] | 1,568 | 2015-01-01T02:12:42.000Z | 2020-03-10T06:24:39.000Z | docker_registry/storage/__init__.py | kirat-singh/docker-registry | ca53d728fb57302606892362820dfaa8aed105c5 | [
"Apache-2.0"
] | 316 | 2015-01-01T01:15:21.000Z | 2018-09-10T21:19:04.000Z | docker_registry/storage/__init__.py | kirat-singh/docker-registry | ca53d728fb57302606892362820dfaa8aed105c5 | [
"Apache-2.0"
] | 596 | 2015-01-03T03:54:42.000Z | 2020-03-05T14:40:55.000Z | # -*- coding: utf-8 -*-
import docker_registry.core.driver as engine
import tempfile
from ..lib import config
__all__ = ['load']
def temp_store_handler():
tmpf = tempfile.TemporaryFile()
def fn(buf):
tmpf.write(buf)
return tmpf, fn
_storage = {}
def load(kind=None):
"""Returns the r... | 16.853659 | 73 | 0.620839 |
import docker_registry.core.driver as engine
import tempfile
from ..lib import config
__all__ = ['load']
def temp_store_handler():
tmpf = tempfile.TemporaryFile()
def fn(buf):
tmpf.write(buf)
return tmpf, fn
_storage = {}
def load(kind=None):
global _storage
cfg = config.load()
... | true | true |
f7183651e5c9a3365c1a19a88fe1f26f07d9c6f3 | 1,745 | py | Python | q2_pepsirf/actions/link.py | LadnerLab/q2-pepsirf | 47de628294cb47d1c1c5881b825e3807b1b5fa02 | [
"Apache-2.0"
] | null | null | null | q2_pepsirf/actions/link.py | LadnerLab/q2-pepsirf | 47de628294cb47d1c1c5881b825e3807b1b5fa02 | [
"Apache-2.0"
] | null | null | null | q2_pepsirf/actions/link.py | LadnerLab/q2-pepsirf | 47de628294cb47d1c1c5881b825e3807b1b5fa02 | [
"Apache-2.0"
] | null | null | null | import subprocess, os
import tempfile, qiime2
from q2_pepsirf.format_types import PeptideFastaFmt, ProteinFastaFmt, PepsirfLinkTSVFormat
# Name: link
# Process: runs pepsirf's link module
# Method inputs/parameters: protein_file, peptide_file, meta,
# kmer_size, kmer_redundancy_control, outfile, pepsirf_binary... | 32.314815 | 91 | 0.664183 | import subprocess, os
import tempfile, qiime2
from q2_pepsirf.format_types import PeptideFastaFmt, ProteinFastaFmt, PepsirfLinkTSVFormat
# Method inputs/parameters: protein_file, peptide_file, meta,
# kmer_size, kmer_redundancy_control, outfile, pepsirf_binary
# Method outputs/Returned: the link tsv
# Dependen... | true | true |
f71836fb5482752ab213272525c889404b51a0e6 | 953 | py | Python | trading_calendars/exchange_calendar_twse.py | playma/stockAI-trading_calendars | 97aa9451961b000ef38e791c394c450015f4724d | [
"Apache-2.0"
] | null | null | null | trading_calendars/exchange_calendar_twse.py | playma/stockAI-trading_calendars | 97aa9451961b000ef38e791c394c450015f4724d | [
"Apache-2.0"
] | null | null | null | trading_calendars/exchange_calendar_twse.py | playma/stockAI-trading_calendars | 97aa9451961b000ef38e791c394c450015f4724d | [
"Apache-2.0"
] | null | null | null | from datetime import time
import pandas as pd
from pytz import timezone
from .precomputed_trading_calendar import PrecomputedTradingCalendar
precomputed_taiwan_holidays = pd.to_datetime([
"1999-01-01",
"1999-02-10",
"1999-02-11",
"1999-02-12",
"1999-02-15",
"1999-02-16"
# TODO
])
class TW... | 23.243902 | 74 | 0.667366 | from datetime import time
import pandas as pd
from pytz import timezone
from .precomputed_trading_calendar import PrecomputedTradingCalendar
precomputed_taiwan_holidays = pd.to_datetime([
"1999-01-01",
"1999-02-10",
"1999-02-11",
"1999-02-12",
"1999-02-15",
"1999-02-16"
])
class TWSEExcha... | true | true |
f71838ec9f6985fcdd4b5b4edd492ad64896a68e | 178 | py | Python | examples/cg_example_pkg/main.py | SMAT-Lab/Scalpel | 1022200043f2d9e8c24256821b863997ab34dd49 | [
"Apache-2.0"
] | 102 | 2021-12-15T09:08:48.000Z | 2022-03-24T15:15:25.000Z | examples/cg_example_pkg/main.py | StarWatch27/Scalpel | 8853e6e84f318f3cfeda0e03d274748b2fbe30fa | [
"Apache-2.0"
] | 11 | 2021-12-04T11:48:31.000Z | 2022-03-21T09:21:45.000Z | examples/cg_example_pkg/main.py | StarWatch27/Scalpel | 8853e6e84f318f3cfeda0e03d274748b2fbe30fa | [
"Apache-2.0"
] | 11 | 2021-12-04T11:47:41.000Z | 2022-02-06T09:04:39.000Z | from .sub_folder1.module1 import Module1
from .sub_folder1.module2 import Module2
module1 = Module1()
do_add = module1.add(1,1)
module2 = Module2()
do_minus = module2.minus(1,1) | 25.428571 | 40 | 0.775281 | from .sub_folder1.module1 import Module1
from .sub_folder1.module2 import Module2
module1 = Module1()
do_add = module1.add(1,1)
module2 = Module2()
do_minus = module2.minus(1,1) | true | true |
f718392acc40e2659410454bda12b4e661825d9c | 1,537 | py | Python | CustomExtension.extension/STVTools.tab/Experiment.panel/Test.pulldown/Tag Seleted.pushbutton/script.py | Melca-G/Aeolus | e014cdbbffc1c650d569efd8750480bc5a4cdc3b | [
"MIT"
] | null | null | null | CustomExtension.extension/STVTools.tab/Experiment.panel/Test.pulldown/Tag Seleted.pushbutton/script.py | Melca-G/Aeolus | e014cdbbffc1c650d569efd8750480bc5a4cdc3b | [
"MIT"
] | null | null | null | CustomExtension.extension/STVTools.tab/Experiment.panel/Test.pulldown/Tag Seleted.pushbutton/script.py | Melca-G/Aeolus | e014cdbbffc1c650d569efd8750480bc5a4cdc3b | [
"MIT"
] | null | null | null |
import sys, clr
import ConfigParser
from os.path import expanduser
# Set system path
home = expanduser("~")
cfgfile = open(home + "\\STVTools.ini", 'r')
config = ConfigParser.ConfigParser()
config.read(home + "\\STVTools.ini")
# Master Path
syspath1 = config.get('SysDir','MasterPackage')
sys.path.append(syspath1)
# Bu... | 39.410256 | 144 | 0.798308 |
import sys, clr
import ConfigParser
from os.path import expanduser
home = expanduser("~")
cfgfile = open(home + "\\STVTools.ini", 'r')
config = ConfigParser.ConfigParser()
config.read(home + "\\STVTools.ini")
syspath1 = config.get('SysDir','MasterPackage')
sys.path.append(syspath1)
syspath2 = config.get('SysDir','Seco... | true | true |
f718393cecda836a590a6dc97b77a13ca4ce20f5 | 70,177 | py | Python | cathpy/core/align.py | shouldsee/cathpy | 5f7fa1322434b2d254f0158c5840f029b12dbafe | [
"MIT"
] | null | null | null | cathpy/core/align.py | shouldsee/cathpy | 5f7fa1322434b2d254f0158c5840f029b12dbafe | [
"MIT"
] | null | null | null | cathpy/core/align.py | shouldsee/cathpy | 5f7fa1322434b2d254f0158c5840f029b12dbafe | [
"MIT"
] | null | null | null | """
Manipulate protein sequences and alignments
"""
# core
import io
import gzip
import logging
import re
import functools
# pip
import dendropy
# local
from cathpy.core import error as err
from cathpy.core.tests import is_valid_domain_id
from cathpy.core.models import AminoAcid, AminoAcids, Residue, Segment
LOG = ... | 38.139674 | 134 | 0.561281 |
import io
import gzip
import logging
import re
import functools
import dendropy
from cathpy.core import error as err
from cathpy.core.tests import is_valid_domain_id
from cathpy.core.models import AminoAcid, AminoAcids, Residue, Segment
LOG = logging.getLogger(__name__)
class Sequence(object):
re_gap_chars = ... | true | true |
f7183a9bcfc54494fe82a755b44a74fff0114292 | 869 | py | Python | examples/pyGriddata/manufactureGAP_patches.py | tmiesse/PolyADCIRC | a4a31dda2c2dac4cd696c0f3827dbbcea7feab33 | [
"BSD-3-Clause"
] | 5 | 2016-03-04T19:42:32.000Z | 2022-01-20T15:39:25.000Z | examples/pyGriddata/manufactureGAP_patches.py | tmiesse/PolyADCIRC | a4a31dda2c2dac4cd696c0f3827dbbcea7feab33 | [
"BSD-3-Clause"
] | 5 | 2015-04-28T05:14:28.000Z | 2017-01-19T12:54:59.000Z | examples/pyGriddata/manufactureGAP_patches.py | UT-CHG/PolyADCIRC | a4a31dda2c2dac4cd696c0f3827dbbcea7feab33 | [
"BSD-3-Clause"
] | 5 | 2016-01-20T00:34:47.000Z | 2022-01-02T11:00:56.000Z | import polyadcirc.run_framework.domain as dom
import polyadcirc.pyGriddata.manufacture_gap as manu
grid_dir = '.'
domain = dom.domain(grid_dir)
domain.read_spatial_grid()
x_values = [n.x for n in domain.node.values()]
y_values = [n.y for n in domain.node.values()]
xr = max(x_values)
xl = min(x_values)
yu = max(y_val... | 24.828571 | 79 | 0.558113 | import polyadcirc.run_framework.domain as dom
import polyadcirc.pyGriddata.manufacture_gap as manu
grid_dir = '.'
domain = dom.domain(grid_dir)
domain.read_spatial_grid()
x_values = [n.x for n in domain.node.values()]
y_values = [n.y for n in domain.node.values()]
xr = max(x_values)
xl = min(x_values)
yu = max(y_val... | true | true |
f7183abbb18c9023d0fc21e6873bb8ac7147a1c6 | 3,095 | py | Python | networkx/algorithms/__init__.py | youssefmahmoud89/networkx | cbf88aaff39ae9247eec426d4a416e759667a15b | [
"BSD-3-Clause"
] | null | null | null | networkx/algorithms/__init__.py | youssefmahmoud89/networkx | cbf88aaff39ae9247eec426d4a416e759667a15b | [
"BSD-3-Clause"
] | null | null | null | networkx/algorithms/__init__.py | youssefmahmoud89/networkx | cbf88aaff39ae9247eec426d4a416e759667a15b | [
"BSD-3-Clause"
] | null | null | null | from networkx.algorithms.assortativity import *
from networkx.algorithms.block import *
from networkx.algorithms.boundary import *
from networkx.algorithms.centrality import *
from networkx.algorithms.cluster import *
from networkx.algorithms.clique import *
from networkx.algorithms.community import *
from networkx.alg... | 40.723684 | 82 | 0.850404 | from networkx.algorithms.assortativity import *
from networkx.algorithms.block import *
from networkx.algorithms.boundary import *
from networkx.algorithms.centrality import *
from networkx.algorithms.cluster import *
from networkx.algorithms.clique import *
from networkx.algorithms.community import *
from networkx.alg... | true | true |
f7183b94cf580f5a6e9ee4b7d2af068f678ffd8b | 5,971 | py | Python | customSDK/servicefabric/models/partition_reconfiguration_completed_event.py | leikong/service-fabric-cli | 6ec1b1c8445b7cc5a889f3b172b47a6017c8888c | [
"MIT"
] | 1 | 2020-06-16T22:32:27.000Z | 2020-06-16T22:32:27.000Z | customSDK/servicefabric/models/partition_reconfiguration_completed_event.py | leikong/service-fabric-cli | 6ec1b1c8445b7cc5a889f3b172b47a6017c8888c | [
"MIT"
] | null | null | null | customSDK/servicefabric/models/partition_reconfiguration_completed_event.py | leikong/service-fabric-cli | 6ec1b1c8445b7cc5a889f3b172b47a6017c8888c | [
"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 ... | 50.601695 | 334 | 0.679116 |
from .partition_event import PartitionEvent
class PartitionReconfigurationCompletedEvent(PartitionEvent):
_validation = {
'event_instance_id': {'required': True},
'time_stamp': {'required': True},
'kind': {'required': True},
'partition_id': {'required': True},
'node_name'... | true | true |
f7183cbd31d35f4bfaba280136946eb69c968a7d | 25,408 | py | Python | z3/z3_utils_hakank.py | Wikunia/hakank | 030bc928d2efe8dcbc5118bda3f8ae9575d0fd13 | [
"MIT"
] | 279 | 2015-01-10T09:55:35.000Z | 2022-03-28T02:34:03.000Z | z3/z3_utils_hakank.py | Wikunia/hakank | 030bc928d2efe8dcbc5118bda3f8ae9575d0fd13 | [
"MIT"
] | 10 | 2017-10-05T15:48:50.000Z | 2021-09-20T12:06:52.000Z | z3/z3_utils_hakank.py | Wikunia/hakank | 030bc928d2efe8dcbc5118bda3f8ae9575d0fd13 | [
"MIT"
] | 83 | 2015-01-20T03:44:00.000Z | 2022-03-13T23:53:06.000Z | #!/usr/bin/python -u
# -*- coding: latin-1 -*-
#
# Utilities and (decompositions of) global constraints in Z3.
#
# Here I have collected some useful (or perhaps not that useful) methods for z3py.
# These where added mostly for simplifying the porting of my "traditional"
# constraint programming models.
#
#
############... | 28.64487 | 117 | 0.609572 |
from __future__ import print_function
from z3 import *
import uuid
import time
def getNewId():
return uuid.uuid4().int
def makeIntVar(sol,name,min_val, max_val):
v = Int(name)
sol.add(v >= min_val, v <= max_val)
return v
def makeIntVarVals(sol,name,vals):
v = Int(name)
sol.add(Or([v == i for ... | true | true |
f7183dfa463649652124a5c44236ae03377d0d36 | 23,967 | py | Python | code/scripts/2020/04/11_12_fine_tune_palminized.py | lucgiffon/psm-nets | dec43c26281febf6e5c8b8f42bfb78098ae7101d | [
"MIT"
] | 1 | 2021-07-15T07:05:18.000Z | 2021-07-15T07:05:18.000Z | code/scripts/2020/04/11_12_fine_tune_palminized.py | lucgiffon/psm-nets | dec43c26281febf6e5c8b8f42bfb78098ae7101d | [
"MIT"
] | 2 | 2021-07-15T06:12:47.000Z | 2021-07-16T10:05:36.000Z | code/scripts/2020/04/11_12_fine_tune_palminized.py | lucgiffon/psm-nets | dec43c26281febf6e5c8b8f42bfb78098ae7101d | [
"MIT"
] | null | null | null | """
This script finds a palminized model with given arguments then finetune it.
Usage:
script.py --input-dir path [-h] [-v|-vv] [--seed int] [--train-val-split float] [--keep-last-layer] [--lr float] [--use-clr policy] [--min-lr float --max-lr float] [--epoch-step-size int] [--nb-epoch int] [--only-mask] [--tb] (-... | 51.653017 | 515 | 0.652147 | import logging
import os
import pickle
import pandas as pd
import sys
from collections import defaultdict
from sklearn.model_selection import train_test_split
import time
from copy import deepcopy
import keras
from keras.engine import Model, InputLayer
import signal
import docopt
from scipy.sparse import coo_matrix
fro... | true | true |
f7183fd3085594df64eada3d76e8fe9e7ca83d8a | 1,056 | py | Python | picymcsortpy/exif_tool.py | patrjon/PicyMcSortpy | 922cd169464afdc6c0ec7e64f14696147f26d595 | [
"MIT"
] | null | null | null | picymcsortpy/exif_tool.py | patrjon/PicyMcSortpy | 922cd169464afdc6c0ec7e64f14696147f26d595 | [
"MIT"
] | null | null | null | picymcsortpy/exif_tool.py | patrjon/PicyMcSortpy | 922cd169464afdc6c0ec7e64f14696147f26d595 | [
"MIT"
] | null | null | null | import subprocess
import json
import os
class ExifTool:
sentinel = "{ready}\n"
def __init__(self, executable="/usr/bin/exiftool"):
self.executable = executable
def __enter__(self):
self.process = subprocess.Popen(
[self.executable, "-stay_open", "True", "-@", "-"],
... | 30.171429 | 69 | 0.60322 | import subprocess
import json
import os
class ExifTool:
sentinel = "{ready}\n"
def __init__(self, executable="/usr/bin/exiftool"):
self.executable = executable
def __enter__(self):
self.process = subprocess.Popen(
[self.executable, "-stay_open", "True", "-@", "-"],
... | true | true |
f7183ff8a33a0e9f78c1b4442d34b7537864c2e0 | 557 | py | Python | src/analytics/migrations/0012_auto_20150408_1024.py | paveu/srvup_rest | 97491df4106d5e8b951c6117770fe74072612e49 | [
"MIT"
] | 1 | 2015-10-10T16:49:30.000Z | 2015-10-10T16:49:30.000Z | src/analytics/migrations/0012_auto_20150408_1024.py | paveu/srvup_rest | 97491df4106d5e8b951c6117770fe74072612e49 | [
"MIT"
] | null | null | null | src/analytics/migrations/0012_auto_20150408_1024.py | paveu/srvup_rest | 97491df4106d5e8b951c6117770fe74072612e49 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('analytics', '0011_auto_20150404_1556'),
]
operations = [
migrations.Al... | 24.217391 | 109 | 0.640934 | from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('analytics', '0011_auto_20150404_1556'),
]
operations = [
migrations.AlterField(
mo... | true | true |
f718404b8071703ea14bb0ff06af2600f0bf9dff | 482 | py | Python | custom/icds_reports/migrations/0105_aww_incentive_report_monthly.py | tobiasmcnulty/commcare-hq | 234aa1fba98a96de1b625bbd70b2066fc877eed1 | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | custom/icds_reports/migrations/0105_aww_incentive_report_monthly.py | tobiasmcnulty/commcare-hq | 234aa1fba98a96de1b625bbd70b2066fc877eed1 | [
"BSD-3-Clause"
] | null | null | null | custom/icds_reports/migrations/0105_aww_incentive_report_monthly.py | tobiasmcnulty/commcare-hq | 234aa1fba98a96de1b625bbd70b2066fc877eed1 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 1.11.16 on 2019-03-12 10:52
from corehq.sql_db.operations import RawSQLMigration
from django.db import migrations
from custom.icds_reports.const import SQL_TEMPLATES_ROOT
migrator = RawSQLMigration((SQL_TEMPLATES_ROOT, 'database_views'))
class Migration(migrations.Migration):
dependencies... | 25.368421 | 67 | 0.753112 | from corehq.sql_db.operations import RawSQLMigration
from django.db import migrations
from custom.icds_reports.const import SQL_TEMPLATES_ROOT
migrator = RawSQLMigration((SQL_TEMPLATES_ROOT, 'database_views'))
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0104_agg_ls_monthly... | true | true |
f71840f3a7a1fdd44593af674c086cc6379e7e61 | 13,265 | py | Python | mne/forward/tests/test_forward.py | dgwakeman/mne-python | 3cc7a3f8456d78c828355f1860dd7e0297e59c73 | [
"BSD-3-Clause"
] | 1 | 2020-12-15T03:07:38.000Z | 2020-12-15T03:07:38.000Z | mne/forward/tests/test_forward.py | dgwakeman/mne-python | 3cc7a3f8456d78c828355f1860dd7e0297e59c73 | [
"BSD-3-Clause"
] | null | null | null | mne/forward/tests/test_forward.py | dgwakeman/mne-python | 3cc7a3f8456d78c828355f1860dd7e0297e59c73 | [
"BSD-3-Clause"
] | null | null | null | import os
import os.path as op
import warnings
import gc
from nose.tools import assert_true, assert_raises
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_equal,
assert_array_equal, assert_allclose)
from mne.datasets import testing
from mne.io import Raw
from... | 39.954819 | 79 | 0.672597 | import os
import os.path as op
import warnings
import gc
from nose.tools import assert_true, assert_raises
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_equal,
assert_array_equal, assert_allclose)
from mne.datasets import testing
from mne.io import Raw
from... | true | true |
f71841007efb94c107588e1a059e02b58a6e4403 | 4,624 | py | Python | models/wide_resnet.py | christophbrgr/ood_detection_framework | c3b7e3064ed8ee4aeb112cd2ab946ee41636f79f | [
"MIT"
] | 7 | 2021-07-26T14:28:51.000Z | 2021-11-18T13:20:00.000Z | models/wide_resnet.py | christophbrgr/ood_detection_framework | c3b7e3064ed8ee4aeb112cd2ab946ee41636f79f | [
"MIT"
] | null | null | null | models/wide_resnet.py | christophbrgr/ood_detection_framework | c3b7e3064ed8ee4aeb112cd2ab946ee41636f79f | [
"MIT"
] | null | null | null | import sys
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from torch.autograd import Variable
def conv3x3(in_planes, out_planes, stride=1):
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=True)
def conv_in... | 33.507246 | 95 | 0.592777 | import sys
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from torch.autograd import Variable
def conv3x3(in_planes, out_planes, stride=1):
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=True)
def conv_in... | true | true |
f71841789466e4e20df0d21ef95d9c6b8ff31374 | 638 | py | Python | examples/jobs.py | 0x9fff00/flask-apscheduler | cc52c39e1948c4e8de5da0d01db45f1779f61997 | [
"Apache-2.0"
] | 1 | 2021-02-08T06:53:31.000Z | 2021-02-08T06:53:31.000Z | examples/jobs.py | 0x9fff00/flask-apscheduler | cc52c39e1948c4e8de5da0d01db45f1779f61997 | [
"Apache-2.0"
] | null | null | null | examples/jobs.py | 0x9fff00/flask-apscheduler | cc52c39e1948c4e8de5da0d01db45f1779f61997 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
from flask_apscheduler import APScheduler
class Config(object):
JOBS = [
{
'id': 'job1',
'func': 'jobs:job1',
'args': (1, 2),
'trigger': 'interval',
'seconds': 10
}
]
SCHEDULER_API_ENABLED = True
def job... | 18.764706 | 52 | 0.557994 | from flask import Flask
from flask_apscheduler import APScheduler
class Config(object):
JOBS = [
{
'id': 'job1',
'func': 'jobs:job1',
'args': (1, 2),
'trigger': 'interval',
'seconds': 10
}
]
SCHEDULER_API_ENABLED = True
def job... | true | true |
f71841cab0f8915fee87ecc76cec17035187d190 | 3,469 | py | Python | sdk/python/pulumi_gcp/compute/__init__.py | 23doors/pulumi-gcp | ded01b199f95b164884266ea3e6f8206c8231270 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_gcp/compute/__init__.py | 23doors/pulumi-gcp | ded01b199f95b164884266ea3e6f8206c8231270 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_gcp/compute/__init__.py | 23doors/pulumi-gcp | ded01b199f95b164884266ea3e6f8206c8231270 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from .address import *
from .attached_disk import *
from .autoscalar import *
from .backend... | 32.726415 | 87 | 0.807437 |
# Export this package's modules as members:
from .address import *
from .attached_disk import *
from .autoscalar import *
from .backend_bucket import *
from .backend_bucket_signed_url_key import *
from .backend_service import *
from .backend_service_signed_url_key import *
from .disk import *
from .disk_resource_polic... | true | true |
f71844d3d33365dc18ad7dca788bcce625f77326 | 8,255 | py | Python | taiga/projects/milestones/models.py | threefoldtech/Threefold-Circles | cbc433796b25cf7af9a295af65d665a4a279e2d6 | [
"Apache-2.0"
] | null | null | null | taiga/projects/milestones/models.py | threefoldtech/Threefold-Circles | cbc433796b25cf7af9a295af65d665a4a279e2d6 | [
"Apache-2.0"
] | 12 | 2019-11-25T14:08:32.000Z | 2021-06-24T10:35:51.000Z | taiga/projects/milestones/models.py | threefoldtech/Threefold-Circles | cbc433796b25cf7af9a295af65d665a4a279e2d6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | 46.903409 | 111 | 0.650151 |
from django.db import models
from django.db.models import Count
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django.core.exceptions import ValidationError
from django.utils.functional import cached_property
from taiga.base.utils.slug i... | true | true |
f718455a325df87d3e545c2788fcccb4ad2bfd8c | 334 | py | Python | setup.py | anthonyshook/healthcare-scraper | 16c9fd4791e89f597f4e5066fbaa8bc02a55f63b | [
"MIT"
] | null | null | null | setup.py | anthonyshook/healthcare-scraper | 16c9fd4791e89f597f4e5066fbaa8bc02a55f63b | [
"MIT"
] | null | null | null | setup.py | anthonyshook/healthcare-scraper | 16c9fd4791e89f597f4e5066fbaa8bc02a55f63b | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name='HealthcareScraper',
version='1.0',
packages=['HealthcareScraper'],
url='',
license='MIT',
author='anthonyshook',
author_email='',
description='Code for Fetching data from the Healthcare.gov website.',
long_description_content_type = 'tex... | 23.857143 | 74 | 0.685629 | from distutils.core import setup
setup(
name='HealthcareScraper',
version='1.0',
packages=['HealthcareScraper'],
url='',
license='MIT',
author='anthonyshook',
author_email='',
description='Code for Fetching data from the Healthcare.gov website.',
long_description_content_type = 'tex... | true | true |
f71845e192e5ae9af44017bb236e7de213806278 | 177 | py | Python | exercicio_05.py | marcusxyyz/Python---Geek-University | 57ec0a5a45d3713bb74ffdae13d778c0708a4749 | [
"Apache-2.0"
] | null | null | null | exercicio_05.py | marcusxyyz/Python---Geek-University | 57ec0a5a45d3713bb74ffdae13d778c0708a4749 | [
"Apache-2.0"
] | null | null | null | exercicio_05.py | marcusxyyz/Python---Geek-University | 57ec0a5a45d3713bb74ffdae13d778c0708a4749 | [
"Apache-2.0"
] | null | null | null | """
Leia um número real e imprima a quinta parte deste número.
"""
num = float(input('Digite um número real: '))
qui = num / 5
print(f'A quinta parte de {num} é {qui}') | 22.125 | 59 | 0.632768 |
num = float(input('Digite um número real: '))
qui = num / 5
print(f'A quinta parte de {num} é {qui}') | true | true |
f71846b951f60a4224bbcba15029808462901768 | 377 | py | Python | Chapter04/c4_09_python_fv.py | andrewjcoxon/Hands-On-Data-Science-with-Anaconda | 82504a059ecd284b3599fa9af2b3eb6bbd6e28f3 | [
"MIT"
] | 25 | 2018-06-25T16:21:09.000Z | 2022-02-08T09:28:29.000Z | Hands-On-Data-Science-with-Anaconda-master/Hands-On-Data-Science-with-Anaconda-master/Chapter04/c4_09_python_fv.py | manual123/Nacho-Jupyter-Notebooks | e75523434b1a90313a6b44e32b056f63de8a7135 | [
"MIT"
] | null | null | null | Hands-On-Data-Science-with-Anaconda-master/Hands-On-Data-Science-with-Anaconda-master/Chapter04/c4_09_python_fv.py | manual123/Nacho-Jupyter-Notebooks | e75523434b1a90313a6b44e32b056f63de8a7135 | [
"MIT"
] | 17 | 2018-06-15T02:55:30.000Z | 2022-03-09T15:24:42.000Z | "
Name : c4_09_python_fv.py
Book : Hands-on Data Science with Anaconda )
Publisher: Packt Publishing Ltd.
Author : Yuxing Yan and James Yan
Date : 1/25/2018
email : yany@canisius.edu
paulyxy@hotmail.com
"
import numpy as np
import matplotlib.pyplot as mlt
n=np.linspace(0,10,... | 20.944444 | 50 | 0.65252 | "
Name : c4_09_python_fv.py
Book : Hands-on Data Science with Anaconda )
Publisher: Packt Publishing Ltd.
Author : Yuxing Yan and James Yan
Date : 1/25/2018
email : yany@canisius.edu
paulyxy@hotmail.com
"
import numpy as np
import matplotlib.pyplot as mlt
n=np.linspace(0,10,... | false | true |
f7184824078e9439bc4fe364829673d0d03fea2d | 2,608 | py | Python | python_bitbankcc/public_api.py | bitbankinc/python-bitbankcc | c1dfddaf39e69499301b6461fa73793f91ee6a76 | [
"MIT"
] | 56 | 2017-08-25T07:39:49.000Z | 2022-03-23T15:04:18.000Z | python_bitbankcc/public_api.py | bitbankinc/python-bitbankcc | c1dfddaf39e69499301b6461fa73793f91ee6a76 | [
"MIT"
] | 7 | 2017-10-10T02:10:01.000Z | 2022-01-12T00:57:50.000Z | python_bitbankcc/public_api.py | bitbankinc/python-bitbankcc | c1dfddaf39e69499301b6461fa73793f91ee6a76 | [
"MIT"
] | 33 | 2017-10-09T17:48:26.000Z | 2022-01-28T18:36:32.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# MIT License
#
# Copyright (c) 2017 bitbank, inc. (ビットバンク株式会社)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includ... | 37.257143 | 82 | 0.695552 |
from __future__ import absolute_import, division, print_function, unicode_literals
from .utils import error_parser, try_json_parse
from logging import getLogger
import requests, contextlib
logger = getLogger(__name__)
class bitbankcc_public(object):
def __init__(self, end_point='https://public.bitbank.cc'... | true | true |
f718490b281d027fc767b61480f567c5c0d98b9b | 2,696 | py | Python | Functions/libsvm-3.23/tools/easy.py | klop670/TwitterBotDetectMLClass | 88a22807a5d07378935d02fbca4cd6cc36a68d24 | [
"MIT"
] | 5 | 2021-05-31T07:03:36.000Z | 2022-01-31T11:51:05.000Z | Functions/libsvm-3.23/tools/easy.py | klop670/TwitterBotDetectMLClass | 88a22807a5d07378935d02fbca4cd6cc36a68d24 | [
"MIT"
] | 2 | 2021-09-27T12:24:42.000Z | 2021-12-02T10:02:31.000Z | Functions/libsvm-3.23/tools/easy.py | klop670/TwitterBotDetectMLClass | 88a22807a5d07378935d02fbca4cd6cc36a68d24 | [
"MIT"
] | 2 | 2020-09-15T12:34:16.000Z | 2021-07-19T00:57:43.000Z | #!/usr/bin/env python
import sys
import os
from subprocess import *
if len(sys.argv) <= 1:
print('Usage: {0} training_file [testing_file]'.format(sys.argv[0]))
raise SystemExit
# svm, grid, and gnuplot executable files
is_win32 = (sys.platform == 'win32')
if not is_win32:
svmscale_exe = "../svm-scale"
svmtrain_... | 33.7 | 104 | 0.700297 |
import sys
import os
from subprocess import *
if len(sys.argv) <= 1:
print('Usage: {0} training_file [testing_file]'.format(sys.argv[0]))
raise SystemExit
is_win32 = (sys.platform == 'win32')
if not is_win32:
svmscale_exe = "../svm-scale"
svmtrain_exe = "../svm-train"
svmpredict_exe = "../svm-predict"
grid_py... | true | true |
f7184a5a9982e3dd5b398457d2310a43a37432e0 | 78,547 | py | Python | python/cudf/cudf/tests/test_binops.py | esoha-nvidia/cudf | 663457b186bbf27ea2926e08438b8c01b5c7633e | [
"Apache-2.0"
] | 1 | 2021-05-02T11:27:22.000Z | 2021-05-02T11:27:22.000Z | python/cudf/cudf/tests/test_binops.py | esoha-nvidia/cudf | 663457b186bbf27ea2926e08438b8c01b5c7633e | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/tests/test_binops.py | esoha-nvidia/cudf | 663457b186bbf27ea2926e08438b8c01b5c7633e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018-2021, NVIDIA CORPORATION.
from __future__ import division
import decimal
import operator
import random
from itertools import product
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.core import Series
from cudf.core.index import as_index
from cudf.tests import utils
fr... | 29.10226 | 79 | 0.571429 |
from __future__ import division
import decimal
import operator
import random
from itertools import product
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.core import Series
from cudf.core.index import as_index
from cudf.tests import utils
from cudf.utils.dtypes import (
BOOL_TYPES,
... | true | true |
f7184ad597b6deed89e33ce74cbeaad1898b35eb | 13,475 | py | Python | catkin_ws/devel_isolated/velodyne_gazebo_plugins/_setup_util.py | LiuXiang199x/DRL_Navigation | 336e847bde8261d429fd2de8111b3d24c0ab4bae | [
"MIT"
] | null | null | null | catkin_ws/devel_isolated/velodyne_gazebo_plugins/_setup_util.py | LiuXiang199x/DRL_Navigation | 336e847bde8261d429fd2de8111b3d24c0ab4bae | [
"MIT"
] | null | null | null | catkin_ws/devel_isolated/velodyne_gazebo_plugins/_setup_util.py | LiuXiang199x/DRL_Navigation | 336e847bde8261d429fd2de8111b3d24c0ab4bae | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistri... | 44.180328 | 227 | 0.684453 |
from __future__ import print_function
import argparse
import copy
import errno
import os
import platform
import sys
CATKIN_MARKER_FILE = '.catkin'
system = platform.system()
IS_DARWIN = (system == 'Darwin')
IS_WINDOWS = (system == 'Windows')
PATH_TO_ADD_SUFFIX = ['bin']
if IS_WINDOWS:
PATH_TO_ADD_SUF... | true | true |
f7184b0f00971a6741fe7e16776ceadd5f5405f9 | 6,542 | py | Python | test_tables.py | FredHappyface/MiniEncoding | e53341fd493c072267fc86d96f4e4a5970fa5116 | [
"MIT"
] | null | null | null | test_tables.py | FredHappyface/MiniEncoding | e53341fd493c072267fc86d96f4e4a5970fa5116 | [
"MIT"
] | 1 | 2020-08-23T20:00:02.000Z | 2020-08-23T20:00:02.000Z | test_tables.py | FredHappyface/MiniEncoding | e53341fd493c072267fc86d96f4e4a5970fa5116 | [
"MIT"
] | null | null | null | """Test the miniencoding lib
A decent testing approach is to test the round trip with a random, valid
string of bytes. by taking this approach, the same error/ bug would have to be
present in both the 'from' and 'to' functions which whilst possible is unlikely
"""
# pylint: disable=invalid-name
import random
import st... | 26.811475 | 150 | 0.67594 | import random
import string
from miniencoding.tables import *
def test_CDC1604_MAGTAPE_len():
assert len(CDC1604_MAGTAPE) == 64
def test_CDC1604_MAGTAPE():
testString = "?1234567890#@??? /STUVWXYZ?,%???-JKLMNOPQR0$*???&ABCDEFGHI0.¤???"
assert toUnicode(CDC1604_MAGTAPE, toCharset(CDC1604_MAGTAPE,
testString)) ==... | true | true |
f7184b32e7e21c95e651877c5d44be93c8cd7ddd | 4,487 | py | Python | GhClimHub/app/views.py | Techyiad/Climate-Mitigant | 3fdbd01d4e2230fa95fc184682351cce389ec87a | [
"MIT"
] | null | null | null | GhClimHub/app/views.py | Techyiad/Climate-Mitigant | 3fdbd01d4e2230fa95fc184682351cce389ec87a | [
"MIT"
] | null | null | null | GhClimHub/app/views.py | Techyiad/Climate-Mitigant | 3fdbd01d4e2230fa95fc184682351cce389ec87a | [
"MIT"
] | null | null | null | """
Definition of views.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import config
from django.shortcuts import render, HttpResponse
from django.http import HttpRequest, JsonResponse
from django.template import RequestContext
import ee
import datetime as dt
import types
im... | 20.869767 | 85 | 0.679964 |
from __future__ import absolute_import, division, print_function, unicode_literals
import config
from django.shortcuts import render, HttpResponse
from django.http import HttpRequest, JsonResponse
from django.template import RequestContext
import ee
import datetime as dt
import types
import os
import json
ee.Ini... | true | true |
f7184bd44950c87f615ff9713fe4e93a8fe0689c | 1,467 | py | Python | prjxray/bitfilter.py | marzoul/prjxray | 7d22a986a22ce21bff8a2a265805d998be9984ed | [
"0BSD"
] | 11 | 2022-02-24T10:36:35.000Z | 2022-03-23T17:44:21.000Z | prjxray/bitfilter.py | marzoul/prjxray | 7d22a986a22ce21bff8a2a265805d998be9984ed | [
"0BSD"
] | 24 | 2022-02-21T14:39:14.000Z | 2022-03-26T13:12:27.000Z | prjxray/bitfilter.py | marzoul/prjxray | 7d22a986a22ce21bff8a2a265805d998be9984ed | [
"0BSD"
] | 4 | 2022-02-24T04:09:49.000Z | 2022-03-28T14:09:34.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
from prjxray.util import OpenSafeFil... | 24.04918 | 76 | 0.61486 |
from prjxray.util import OpenSafeFile
class Bitfilter(object):
def __init__(
self, frames_to_include=None, frames_to_exclude=[],
bits_to_exclude=[]):
self.frames_to_include = frames_to_include
self.frames_to_exclude = frames_to_exclude
self.bits_to_exclude = bits_to... | true | true |
f7184c3aef6158e81045f4622232b9d88401dd8f | 740 | py | Python | Trabalho 03 - Tutorial Flask/r. Flask Sijax (with Examples)/server.py | andressagomes26/tecWeb_UFC | 5796a73295e799ef1dd33037edc041d4c08ede31 | [
"MIT"
] | null | null | null | Trabalho 03 - Tutorial Flask/r. Flask Sijax (with Examples)/server.py | andressagomes26/tecWeb_UFC | 5796a73295e799ef1dd33037edc041d4c08ede31 | [
"MIT"
] | null | null | null | Trabalho 03 - Tutorial Flask/r. Flask Sijax (with Examples)/server.py | andressagomes26/tecWeb_UFC | 5796a73295e799ef1dd33037edc041d4c08ede31 | [
"MIT"
] | null | null | null | import os
from flask import Flask, g
from flask_sijax import sijax
path = os.path.join('.', os.path.dirname(__file__), 'static/js/sijax/')
app = Flask(__name__)
app.config['SIJAX_STATIC_PATH'] = path
app.config['SIJAX_JSON_URI'] = '/static/js/sijax/json2.js'
flask_sijax.Sijax(app)
@app.route('/')
def index():
r... | 23.870968 | 71 | 0.686486 | import os
from flask import Flask, g
from flask_sijax import sijax
path = os.path.join('.', os.path.dirname(__file__), 'static/js/sijax/')
app = Flask(__name__)
app.config['SIJAX_STATIC_PATH'] = path
app.config['SIJAX_JSON_URI'] = '/static/js/sijax/json2.js'
flask_sijax.Sijax(app)
@app.route('/')
def index():
r... | true | true |
f7184ccd6b6803c7798939baac5536c41c8729ec | 351 | py | Python | docs/conf.py | nestauk/AFS_analysis_childcare_providers | be2def68aca3c334a0c42c2bb1390e0dcbf2324e | [
"MIT"
] | null | null | null | docs/conf.py | nestauk/AFS_analysis_childcare_providers | be2def68aca3c334a0c42c2bb1390e0dcbf2324e | [
"MIT"
] | 3 | 2021-07-01T14:47:33.000Z | 2021-07-12T09:15:11.000Z | docs/conf.py | nestauk/AFS_analysis_childcare_providers | be2def68aca3c334a0c42c2bb1390e0dcbf2324e | [
"MIT"
] | null | null | null | """Sphinx configuration."""
from datetime import datetime
project = "AFS_analysis_childcare_providers"
author = "Nesta"
copyright = f"{datetime.now().year}, {author}"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
# "sphinx_click",
"sphinx_rtd_theme",
]
autodoc_typehints = "description"
h... | 21.9375 | 46 | 0.7151 | from datetime import datetime
project = "AFS_analysis_childcare_providers"
author = "Nesta"
copyright = f"{datetime.now().year}, {author}"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx_rtd_theme",
]
autodoc_typehints = "description"
html_theme = "sphinx_rtd_theme"
| true | true |
f7184d25a5cbe14001067f661eafef38d03c4323 | 3,457 | py | Python | patient/views.py | evantoh/patient-management-system | 6637eb1344775633759165260ed99843581c0e72 | [
"Unlicense"
] | 1 | 2018-03-22T17:50:24.000Z | 2018-03-22T17:50:24.000Z | patient/views.py | evantoh/patient-management-system | 6637eb1344775633759165260ed99843581c0e72 | [
"Unlicense"
] | null | null | null | patient/views.py | evantoh/patient-management-system | 6637eb1344775633759165260ed99843581c0e72 | [
"Unlicense"
] | null | null | null | from django.shortcuts import render,redirect
from .forms import UpdateDocForm,addPatientForm,TreatmentForm,NewNextOfKinForm,NewMedicineForm
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from .models import Doctor,Medicine,NextOfKin,Patient
# Create your views here... | 40.197674 | 128 | 0.692219 | from django.shortcuts import render,redirect
from .forms import UpdateDocForm,addPatientForm,TreatmentForm,NewNextOfKinForm,NewMedicineForm
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from .models import Doctor,Medicine,NextOfKin,Patient
@login_required(login_ur... | true | true |
f7184db8be5aae4710f320641fc22c1c336bb606 | 2,049 | py | Python | lib/ansiblelint/rules/UseHandlerRatherThanWhenChangedRule.py | senyoltw/ansible-lint | 0e53d73c97601351bbac8a6d2eb092efb29609b8 | [
"MIT"
] | null | null | null | lib/ansiblelint/rules/UseHandlerRatherThanWhenChangedRule.py | senyoltw/ansible-lint | 0e53d73c97601351bbac8a6d2eb092efb29609b8 | [
"MIT"
] | 48 | 2021-03-08T21:13:17.000Z | 2022-02-13T12:05:41.000Z | lib/ansiblelint/rules/UseHandlerRatherThanWhenChangedRule.py | xlab-steampunk/ansible-lint | 443b2dcad2b9fd7bea63c8d9378f3fea13b57e7d | [
"MIT"
] | null | null | null | # Copyright (c) 2016 Will Thames <will@thames.id.au>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, mer... | 38.660377 | 79 | 0.701806 |
from ansiblelint.rules import AnsibleLintRule
def _changed_in_when(item):
if not isinstance(item, str):
return False
return any(changed in item for changed in
['.changed', '|changed', '["changed"]', "['changed']"])
class UseHandlerRatherThanWhenChangedRule(AnsibleLintRule):
id = ... | true | true |
f7184e5c4fd91fba665031f6ca129fc77bd5348b | 37,578 | py | Python | kubernetes_tests/test_kubernetes_pod_operator.py | iadi7ya/airflow | 00ffedb8c402eb5638782628eb706a5f28215eac | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-03-12T20:05:38.000Z | 2021-03-12T20:05:38.000Z | kubernetes_tests/test_kubernetes_pod_operator.py | iadi7ya/airflow | 00ffedb8c402eb5638782628eb706a5f28215eac | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 14 | 2019-12-03T02:54:42.000Z | 2020-02-27T16:08:10.000Z | kubernetes_tests/test_kubernetes_pod_operator.py | iadi7ya/airflow | 00ffedb8c402eb5638782628eb706a5f28215eac | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-07-02T04:23:18.000Z | 2021-07-02T04:23:18.000Z | # pylint: disable=unused-argument
# 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.... | 38.30581 | 104 | 0.526159 | import json
import logging
import os
import random
import shutil
import sys
import textwrap
import unittest
from unittest import mock
from unittest.mock import ANY
import pendulum
from kubernetes.client import models as k8s
from kubernetes.client.api_client import ApiClient
from kubernetes.client.rest import ApiExcept... | true | true |
f7184fb7953e6e5d92cdd9eb99f985d3e77150c6 | 17,204 | py | Python | megatron/tokenizer/bert_tokenization_jp.py | Xianchao-Wu/megatron2 | f793c37223b32051cb61d3b1d5661dddd57634bf | [
"MIT"
] | 1 | 2022-03-24T11:13:41.000Z | 2022-03-24T11:13:41.000Z | megatron/tokenizer/bert_tokenization_jp.py | Xianchao-Wu/megatron2 | f793c37223b32051cb61d3b1d5661dddd57634bf | [
"MIT"
] | null | null | null | megatron/tokenizer/bert_tokenization_jp.py | Xianchao-Wu/megatron2 | f793c37223b32051cb61d3b1d5661dddd57634bf | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 36.142857 | 125 | 0.599337 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import re
import unicodedata
import six
def validate_case_matches_checkpoint(do_lower_case, init_checkpoint):
# we have to heuristically detect it to validate.
if no... | true | true |
f7184fbe3298b23a055b69dc325807e7b96a0395 | 9,213 | py | Python | app/organisation/rest.py | alphagov/notify-notifications-api | e604385e0cf4c2ab8c6451b7120ceb196cce21b5 | [
"MIT"
] | null | null | null | app/organisation/rest.py | alphagov/notify-notifications-api | e604385e0cf4c2ab8c6451b7120ceb196cce21b5 | [
"MIT"
] | null | null | null | app/organisation/rest.py | alphagov/notify-notifications-api | e604385e0cf4c2ab8c6451b7120ceb196cce21b5 | [
"MIT"
] | null | null | null |
from flask import Blueprint, abort, current_app, jsonify, request
from sqlalchemy.exc import IntegrityError
from app.config import QueueNames
from app.dao.annual_billing_dao import set_default_free_allowance_for_service
from app.dao.dao_utils import transaction
from app.dao.fact_billing_dao import fetch_usage_year_fo... | 36.705179 | 113 | 0.74308 |
from flask import Blueprint, abort, current_app, jsonify, request
from sqlalchemy.exc import IntegrityError
from app.config import QueueNames
from app.dao.annual_billing_dao import set_default_free_allowance_for_service
from app.dao.dao_utils import transaction
from app.dao.fact_billing_dao import fetch_usage_year_fo... | true | true |
f7184fe1e35a9bafa86e0dff622a375b70bb8869 | 24,838 | py | Python | src/python/pants/bsp/util_rules/targets.py | wonlay/pants | 53c66503b6898e83c9c9596e56cde5ad9ed6a0d3 | [
"Apache-2.0"
] | null | null | null | src/python/pants/bsp/util_rules/targets.py | wonlay/pants | 53c66503b6898e83c9c9596e56cde5ad9ed6a0d3 | [
"Apache-2.0"
] | null | null | null | src/python/pants/bsp/util_rules/targets.py | wonlay/pants | 53c66503b6898e83c9c9596e56cde5ad9ed6a0d3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import itertools
import logging
from collections import defaultdict
from dataclasses import dataclass
from pathlib import Path
from typing import ClassVa... | 36.366032 | 113 | 0.697882 | from __future__ import annotations
import itertools
import logging
from collections import defaultdict
from dataclasses import dataclass
from pathlib import Path
from typing import ClassVar, Generic, Sequence, Type, TypeVar
import toml
from typing_extensions import Protocol
from pants.base.build_root import BuildRoo... | true | true |
f71850126d2abeba717e7db8f36f67882ab8adf7 | 2,917 | py | Python | ws/src/lab/src/case_suite/case_bringup/launch/opc_r3.launch.py | Cobots-Kandidatarbete/cobots | 8186910e6d30569f95ed6ebe4645ba05ecc53864 | [
"MIT"
] | 2 | 2022-02-22T13:36:41.000Z | 2022-02-22T13:39:41.000Z | ws/src/lab/src/case_suite/case_bringup/launch/opc_r3.launch.py | Cobots-Kandidatarbete/cobots | 8186910e6d30569f95ed6ebe4645ba05ecc53864 | [
"MIT"
] | null | null | null | ws/src/lab/src/case_suite/case_bringup/launch/opc_r3.launch.py | Cobots-Kandidatarbete/cobots | 8186910e6d30569f95ed6ebe4645ba05ecc53864 | [
"MIT"
] | null | null | null | import sys
from launch import LaunchDescription, LaunchService
from launch_ros.actions import Node
def generate_launch_description():
opcua_parameters = {
"server_address": "opc.tcp://192.168.100.30:4840/",
"node_ids": ["ns=4;s=|var|CODESYS CONTROL FOR Raspberry Pi MC SL.Application.IO.bool_from_p... | 54.018519 | 106 | 0.624957 | import sys
from launch import LaunchDescription, LaunchService
from launch_ros.actions import Node
def generate_launch_description():
opcua_parameters = {
"server_address": "opc.tcp://192.168.100.30:4840/",
"node_ids": ["ns=4;s=|var|CODESYS CONTROL FOR Raspberry Pi MC SL.Application.IO.bool_from_p... | true | true |
f718504c718d307f86f64b15bbb585f07e359260 | 1,681 | py | Python | source/sam_spot_bot_function/app.py | liangfu/spot-tagging-bot-for-digital-assets | 81b2a960a87da988904250b1f605e052e7e2c7a8 | [
"Apache-2.0"
] | 19 | 2020-08-26T02:29:55.000Z | 2022-01-21T15:26:31.000Z | source/sam_spot_bot_function/app.py | liangfu/spot-tagging-bot-for-digital-assets | 81b2a960a87da988904250b1f605e052e7e2c7a8 | [
"Apache-2.0"
] | 2 | 2020-09-02T07:22:26.000Z | 2020-11-17T06:41:20.000Z | source/sam_spot_bot_function/app.py | liangfu/spot-tagging-bot-for-digital-assets | 81b2a960a87da988904250b1f605e052e7e2c7a8 | [
"Apache-2.0"
] | 6 | 2020-09-14T06:56:59.000Z | 2021-10-20T14:46:36.000Z | import boto3
import json
import os
from sam_spot_bot_create_job.bot_dao import BotDao
# Global variables are reused across execution contexts (if available)
session = boto3.Session()
def lambda_handler(event, context):
"""
Sample json in API request body -
{
"name": name,
"fi... | 27.112903 | 70 | 0.56395 | import boto3
import json
import os
from sam_spot_bot_create_job.bot_dao import BotDao
session = boto3.Session()
def lambda_handler(event, context):
print("Received event: " + json.dumps(event, indent=2))
print("All ENV " + str(os.environ))
method = event["httpMethod"]
request_body = json.loads(event... | true | true |
f718505155a29c9ef2efeb5cf94702dd1819b526 | 9,900 | py | Python | arsdk-xml/ARSDKBuildUtils/Utils/Python/commandLine.py | 2016-Capstone/PythonController | d8b241a4e7efdeb82ddd04830e3e8470eeeb8e34 | [
"BSD-3-Clause"
] | 114 | 2015-05-20T09:04:18.000Z | 2021-09-07T22:01:47.000Z | arsdk-xml/ARSDKBuildUtils/Utils/Python/commandLine.py | 2016-Capstone/PythonController | d8b241a4e7efdeb82ddd04830e3e8470eeeb8e34 | [
"BSD-3-Clause"
] | 40 | 2015-01-04T10:30:24.000Z | 2015-05-18T15:33:50.000Z | arsdk-xml/ARSDKBuildUtils/Utils/Python/commandLine.py | 2016-Capstone/PythonController | d8b241a4e7efdeb82ddd04830e3e8470eeeb8e34 | [
"BSD-3-Clause"
] | 64 | 2015-05-20T04:44:31.000Z | 2021-06-02T17:32:47.000Z | '''
Copyright (C) 2014 Parrot SA
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 the following di... | 48.058252 | 223 | 0.629394 | import os
import argparse
from ARFuncs import *
defaultBaseRepoUrl = 'https://github.com/Parrot-Developers/'
class CommandLineParser:
def __init__(self, targets, libraries, binaries):
self.availableTargets = targets
self.availableLibraries = libraries
self.availableBinaries = binaries
... | true | true |
f71851d73851a92028fa4c056721e8e576126e24 | 3,458 | py | Python | source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/update_scheduled_task.py | aws-solutions/maintaining-personalized-experiences-with-machine-learning | 3f6f1b0069df4828eae9b0835b717500189e4f71 | [
"Apache-2.0"
] | 6 | 2021-09-23T16:33:24.000Z | 2022-03-31T11:45:13.000Z | source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/update_scheduled_task.py | aws-solutions/maintaining-personalized-experiences-with-machine-learning | 3f6f1b0069df4828eae9b0835b717500189e4f71 | [
"Apache-2.0"
] | 4 | 2021-09-24T21:34:14.000Z | 2022-01-27T22:11:08.000Z | source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/update_scheduled_task.py | aws-solutions/maintaining-personalized-experiences-with-machine-learning | 3f6f1b0069df4828eae9b0835b717500189e4f71 | [
"Apache-2.0"
] | 9 | 2021-09-23T23:24:46.000Z | 2022-02-12T04:53:16.000Z | # ######################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 45.5 | 120 | 0.486119 |
from pathlib import Path
from typing import Optional
import aws_cdk.aws_iam as iam
from aws_cdk.aws_dynamodb import ITable
from aws_cdk.aws_stepfunctions import IChainable
from constructs import Construct
from aws_solutions.cdk.stepfunctions.solutionstep import SolutionStep
class UpdateScheduledTask(SolutionStep):... | true | true |
f718524ed9b3ed02ed271f8ab5bcf8dab7659d7c | 1,620 | py | Python | October/Week1/Combination Sum.py | vinaykumar7686/Leetcode-August_Challenge | fe1928d8b10a63d7aa561118a70eeaec2f3a2f36 | [
"MIT"
] | 1 | 2020-08-02T13:41:38.000Z | 2020-08-02T13:41:38.000Z | October/Week1/Combination Sum.py | vinaykumar7686/Leetcode-August_Challenge | fe1928d8b10a63d7aa561118a70eeaec2f3a2f36 | [
"MIT"
] | null | null | null | October/Week1/Combination Sum.py | vinaykumar7686/Leetcode-August_Challenge | fe1928d8b10a63d7aa561118a70eeaec2f3a2f36 | [
"MIT"
] | null | null | null | # Combination Sum
'''
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order.
The same number may be chosen from candidates an unlimited number of times. Two... | 25.714286 | 216 | 0.598148 |
class Solution:
def combinationSum(self, nums: List[int], target: int) -> List[List[int]]:
ans = []
def backtrack(val, arr):
if val == target:
arr.sort()
if arr not in ans:
ans.append(arr)
return
if val>tar... | true | true |
f718528de2b098c3b1736d5dfd5dd63528268733 | 3,613 | py | Python | utils.py | pedbrgs/anomaly-detection-tool | 1b5d89eb1287eb13849d87851a8c3c4cc708a93e | [
"MIT"
] | null | null | null | utils.py | pedbrgs/anomaly-detection-tool | 1b5d89eb1287eb13849d87851a8c3c4cc708a93e | [
"MIT"
] | null | null | null | utils.py | pedbrgs/anomaly-detection-tool | 1b5d89eb1287eb13849d87851a8c3c4cc708a93e | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
import torch
import torchvision.models as models
from torch.autograd import Variable
import torchvision.transforms as transforms
def plot_image(image, figsize):
""" Display an image """
fig = plt.figure(figsize = figsiz... | 31.417391 | 159 | 0.66067 | import cv2
import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
import torch
import torchvision.models as models
from torch.autograd import Variable
import torchvision.transforms as transforms
def plot_image(image, figsize):
fig = plt.figure(figsize = figsize)
plt.imshow(image, cmap... | true | true |
f718543ecc3c5723ef58047300881c34e670147d | 13,253 | py | Python | TNT.py | cjh3020889729/Regular-season-Palm-pathological-myopia-prediction-May-10th-program | 325867c0966c803f5b50c8758c1a83dcc6f6ed2c | [
"Apache-2.0"
] | null | null | null | TNT.py | cjh3020889729/Regular-season-Palm-pathological-myopia-prediction-May-10th-program | 325867c0966c803f5b50c8758c1a83dcc6f6ed2c | [
"Apache-2.0"
] | null | null | null | TNT.py | cjh3020889729/Regular-season-Palm-pathological-myopia-prediction-May-10th-program | 325867c0966c803f5b50c8758c1a83dcc6f6ed2c | [
"Apache-2.0"
] | null | null | null | import paddle
from paddle import nn
import math
import numpy as np
def _cfg(url='', **kwargs):
return {
'url': url,
'num_classes': 2, 'input_size': (3, 600, 600), 'pool_size': None,
'crop_pct': .9, 'interpolation': 'bicubic',
'mean': (0.5, 0.5, 0.5), 'std': (0.5, 0.5, 0.... | 43.169381 | 192 | 0.628688 | import paddle
from paddle import nn
import math
import numpy as np
def _cfg(url='', **kwargs):
return {
'url': url,
'num_classes': 2, 'input_size': (3, 600, 600), 'pool_size': None,
'crop_pct': .9, 'interpolation': 'bicubic',
'mean': (0.5, 0.5, 0.5), 'std': (0.5, 0.5, 0.... | true | true |
f71854cf216fd9c15655470c36650db459061d05 | 28,170 | py | Python | KSFD/ksfdtimeseries.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | KSFD/ksfdtimeseries.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | KSFD/ksfdtimeseries.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | """
MPI-aware read and write PETSc Vec to HDF5
The goal of this module is to save snapshots of a PETSc Vec to HDF5
files, and obviously to read them again later. The obvious way to do
this is parallel HDF5. Unfortunately, distributions of HDF5 and h5py
may be built without support for parallel operation. (In particula... | 33.939759 | 80 | 0.540469 | import h5py, os, re, gc, time
import traceback as tb
import numpy as np
import petsc4py
from mpi4py import MPI
try:
from .ksfddebug import log
from .ksfdgrid import Grid
except ImportError:
from ksfddebug import log
from ksfdgrid import Grid
def logSERIES(*args, **kwargs):
log(*args, system='SERIES... | true | true |
f71855f208ab8ced26bd5c8f92d1e3a2a33c6e63 | 3,436 | py | Python | infra/src/custom_constructs/construct_sagemaker_role.py | elangovana/pubmed-bpe-tokeniser | d5268280c11403a5fe4e740bd1b1953ed1fb5792 | [
"Apache-2.0"
] | 1 | 2020-10-25T11:25:05.000Z | 2020-10-25T11:25:05.000Z | infra/src/custom_constructs/construct_sagemaker_role.py | elangovana/pubmed-bpe-tokeniser | d5268280c11403a5fe4e740bd1b1953ed1fb5792 | [
"Apache-2.0"
] | null | null | null | infra/src/custom_constructs/construct_sagemaker_role.py | elangovana/pubmed-bpe-tokeniser | d5268280c11403a5fe4e740bd1b1953ed1fb5792 | [
"Apache-2.0"
] | null | null | null | # *****************************************************************************
# * Copyright 2020 Amazon.com, Inc. and its affiliates. All Rights Reserved. *
# *
# Licensed under the Amazon Software License (the "License"). *
... | 54.539683 | 110 | 0.425786 | from aws_cdk import aws_iam, core
from aws_cdk.aws_iam import IManagedPolicy, ServicePrincipal
class ConstructSageMakerRole(aws_iam.Role):
def __init__(self, scope: core.Construct, id: str, managed_policy: IManagedPolicy, role_name: str = None):
s3_sagemaker_bucket_access = aws_iam.PolicyDocument... | true | true |
f71856627f584e51686016c94360ad7a2de56085 | 1,143 | py | Python | aoc2021/day7.py | jonsth131/aoc | f5d82bdcdeb2eea13dec3135dd0590b4a3bf1ebd | [
"MIT"
] | null | null | null | aoc2021/day7.py | jonsth131/aoc | f5d82bdcdeb2eea13dec3135dd0590b4a3bf1ebd | [
"MIT"
] | null | null | null | aoc2021/day7.py | jonsth131/aoc | f5d82bdcdeb2eea13dec3135dd0590b4a3bf1ebd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import fileutils
def part1(lst):
positions = parse_positions(lst)
def calc(x, i):
return abs(x - i)
return get_min_fuel(positions, calc)
def part2(lst):
positions = parse_positions(lst)
def calc(x, i):
n = abs(x - i)
return n * (n + 1) / 2
r... | 22.411765 | 64 | 0.593176 | import fileutils
def part1(lst):
positions = parse_positions(lst)
def calc(x, i):
return abs(x - i)
return get_min_fuel(positions, calc)
def part2(lst):
positions = parse_positions(lst)
def calc(x, i):
n = abs(x - i)
return n * (n + 1) / 2
return get_min_fuel(posi... | true | true |
f71857a3cbaddb52fc4da082f504fcbc5c405bd9 | 7,297 | py | Python | tensorflow/python/kernel_tests/manip_ops_test.py | knightvishal/tensorflow | 5d3dd19b7146d954fc1b4e9e44e9881e75d363c1 | [
"Apache-2.0"
] | 52 | 2018-11-12T06:39:35.000Z | 2022-03-08T05:31:27.000Z | tensorflow/python/kernel_tests/manip_ops_test.py | knightvishal/tensorflow | 5d3dd19b7146d954fc1b4e9e44e9881e75d363c1 | [
"Apache-2.0"
] | 2 | 2018-12-04T08:35:40.000Z | 2020-10-22T16:17:39.000Z | tensorflow/python/kernel_tests/manip_ops_test.py | knightvishal/tensorflow | 5d3dd19b7146d954fc1b4e9e44e9881e75d363c1 | [
"Apache-2.0"
] | 17 | 2019-03-11T01:17:16.000Z | 2022-02-21T00:44:47.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.994382 | 80 | 0.65383 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors_impl
from tensorflow.python.framework import... | true | true |
f71857baefe7eed8b229f6b0364b386030558999 | 10,986 | py | Python | Configs/explore_configs/S7_explore_Lifestyle_n_Activity.py | yochaiedlitz/T2DM_UKB_predictions | 1e6b22e3d51d515eb065d7d5f46408f86f33d0b8 | [
"MIT"
] | 1 | 2022-01-17T13:13:02.000Z | 2022-01-17T13:13:02.000Z | Configs/explore_configs/S7_explore_Lifestyle_n_Activity.py | yochaiedlitz/T2DM_UKB_predictions | 1e6b22e3d51d515eb065d7d5f46408f86f33d0b8 | [
"MIT"
] | null | null | null | Configs/explore_configs/S7_explore_Lifestyle_n_Activity.py | yochaiedlitz/T2DM_UKB_predictions | 1e6b22e3d51d515eb065d7d5f46408f86f33d0b8 | [
"MIT"
] | null | null | null | import collections # Used for ordered dictionary
from PRS import PRS_sumstats
from UKBB_Functions import PROBA_FOLDER
import sys
Top_Gen_Dict = PRS_sumstats.Get_Top_Gen_Dict()
Hyp_Param_Dict_A = collections.OrderedDict()
Hyp_Param_Dict_R = collections.OrderedDict()
# TRAIN_PATH = '/net/mraid08/export/jafar/UKBioBank/D... | 60.032787 | 301 | 0.706354 | import collections from PRS import PRS_sumstats
from UKBB_Functions import PROBA_FOLDER
import sys
Top_Gen_Dict = PRS_sumstats.Get_Top_Gen_Dict()
Hyp_Param_Dict_A = collections.OrderedDict()
Hyp_Param_Dict_R = collections.OrderedDict()
TRAIN_PATH=Imputed_TRAIN_TEST_PATH = '/net/mraid08/export/jafar/UKBioBank/Data/ukb2... | true | true |
f718581e08eecfa5071a2fbf325d02e2ff15bedc | 22 | py | Python | vida/vida/__init__.py | smesdaghi/vida | 271c897b332f0c24e00a23c1fe86f5172fb9dd30 | [
"MIT"
] | 2 | 2016-01-09T15:45:46.000Z | 2019-04-28T03:56:13.000Z | vida/vida/__init__.py | smesdaghi/vida | 271c897b332f0c24e00a23c1fe86f5172fb9dd30 | [
"MIT"
] | 3 | 2015-09-26T16:31:19.000Z | 2015-10-07T13:03:00.000Z | vida/vida/__init__.py | smesdaghi/vida | 271c897b332f0c24e00a23c1fe86f5172fb9dd30 | [
"MIT"
] | 4 | 2016-01-20T13:06:31.000Z | 2019-09-13T14:52:00.000Z | __author__ = 's30244'
| 11 | 21 | 0.727273 | __author__ = 's30244'
| true | true |
f71858bb17f89fb6223fdd8d8e5d81ceec6d75a9 | 3,307 | py | Python | tacker/nfvo/workflows/vim_monitor/vim_monitor_utils.py | h1r0mu/tacker | 8c69dda51fcfe215c4878a86b82018d2b96e5561 | [
"Apache-2.0"
] | 116 | 2015-10-18T02:57:08.000Z | 2022-03-15T04:09:18.000Z | tacker/nfvo/workflows/vim_monitor/vim_monitor_utils.py | h1r0mu/tacker | 8c69dda51fcfe215c4878a86b82018d2b96e5561 | [
"Apache-2.0"
] | 6 | 2016-11-07T22:15:54.000Z | 2021-05-09T06:13:08.000Z | tacker/nfvo/workflows/vim_monitor/vim_monitor_utils.py | h1r0mu/tacker | 8c69dda51fcfe215c4878a86b82018d2b96e5561 | [
"Apache-2.0"
] | 166 | 2015-10-20T15:31:52.000Z | 2021-11-12T08:39:49.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# di... | 34.810526 | 77 | 0.713335 |
import yaml
from oslo_config import cfg
from oslo_log import log as logging
from tacker.common import rpc
from tacker.mistral.actionrpc import kill_action as killaction
from tacker.mistral import mistral_client
from tacker.nfvo.workflows.vim_monitor import workflow_generator
from tacker.vnfm import keystone
LOG = ... | true | true |
f71859abfa33f2df3bfb30d851d602fbf51a1f8a | 525 | py | Python | src/cmd_exec/util/SystemUtil.py | ahuyuktepe/cmd-exec | 835037a4b7784d4901bf35db5eaa88a0757c5ce9 | [
"MIT"
] | null | null | null | src/cmd_exec/util/SystemUtil.py | ahuyuktepe/cmd-exec | 835037a4b7784d4901bf35db5eaa88a0757c5ce9 | [
"MIT"
] | 1 | 2021-06-07T21:25:52.000Z | 2021-06-07T21:25:52.000Z | src/cmd_exec/util/SystemUtil.py | ahuyuktepe/cmd-exec | 835037a4b7784d4901bf35db5eaa88a0757c5ce9 | [
"MIT"
] | null | null | null | import getpass
import os
import platform
class SystemUtil:
__SYSTEM_NAMES_WINDOWS: set = ['Windows']
@staticmethod
def isWindows() -> bool:
osName: str = platform.system()
return osName in SystemUtil.__SYSTEM_NAMES_WINDOWS
@staticmethod
def getCurrentUserName() -> s... | 22.826087 | 59 | 0.630476 | import getpass
import os
import platform
class SystemUtil:
__SYSTEM_NAMES_WINDOWS: set = ['Windows']
@staticmethod
def isWindows() -> bool:
osName: str = platform.system()
return osName in SystemUtil.__SYSTEM_NAMES_WINDOWS
@staticmethod
def getCurrentUserName() -> s... | true | true |
f71859cec54c2858e6e96dfaa122fa325313a2ed | 5,325 | py | Python | artellapipe/core/assetfile.py | ArtellaPipe/artellapipe | 3400f6a55f124f639143fe01c559059eaba23b22 | [
"MIT"
] | 7 | 2019-10-28T05:18:30.000Z | 2020-08-21T05:36:52.000Z | artellapipe/core/assetfile.py | tpoveda/artellapipe | 3400f6a55f124f639143fe01c559059eaba23b22 | [
"MIT"
] | 4 | 2020-01-22T02:41:54.000Z | 2020-03-17T10:49:12.000Z | artellapipe/core/assetfile.py | tpoveda/artellapipe | 3400f6a55f124f639143fe01c559059eaba23b22 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains implementations for asset files
"""
from __future__ import print_function, division, absolute_import
__author__ = "Tomas Poveda"
__license__ = "MIT"
__maintainer__ = "Tomas Poveda"
__email__ = "tpovedatd@gmail.com"
import os
import logging
imp... | 29.583333 | 116 | 0.624977 |
from __future__ import print_function, division, absolute_import
__author__ = "Tomas Poveda"
__license__ = "MIT"
__maintainer__ = "Tomas Poveda"
__email__ = "tpovedatd@gmail.com"
import os
import logging
import tpDcc as tp
from tpDcc.libs.python import osplatform, path as path_utils
import artellapipe
from artell... | true | true |
f7185b30e364d852691b3186ed2a5799603f94f0 | 58,998 | py | Python | python/ccxt/bitmex.py | myhlcb/ccxt | 828a373821269d846f418c056f6e4c922d56d18c | [
"MIT"
] | 1 | 2021-01-21T23:29:27.000Z | 2021-01-21T23:29:27.000Z | python/ccxt/bitmex.py | myhlcb/ccxt | 828a373821269d846f418c056f6e4c922d56d18c | [
"MIT"
] | 1 | 2020-09-17T13:57:58.000Z | 2020-09-17T13:57:58.000Z | python/ccxt/bitmex.py | myhlcb/ccxt | 828a373821269d846f418c056f6e4c922d56d18c | [
"MIT"
] | 2 | 2020-06-17T14:28:46.000Z | 2022-02-26T13:36:02.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from cc... | 41.402105 | 233 | 0.45927 |
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import BadRequest
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.b... | true | true |
f7185c26056ae7dced24a2c6d6d3e11cf667b77f | 4,543 | py | Python | utils/avg_checkpoints.py | didichuxing/delta | 31dfebc8f20b7cb282b62f291ff25a87e403cc86 | [
"Apache-2.0"
] | 1,442 | 2019-07-09T07:34:28.000Z | 2020-11-15T09:52:09.000Z | utils/avg_checkpoints.py | didichuxing/delta | 31dfebc8f20b7cb282b62f291ff25a87e403cc86 | [
"Apache-2.0"
] | 93 | 2019-07-22T09:20:20.000Z | 2020-11-13T01:59:30.000Z | utils/avg_checkpoints.py | didichuxing/delta | 31dfebc8f20b7cb282b62f291ff25a87e403cc86 | [
"Apache-2.0"
] | 296 | 2019-07-09T07:35:28.000Z | 2020-11-16T02:27:51.000Z | #!/usr/bin/env python3
# Copyright 2019 The Tensor2Tensor Authors.
#
# 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 ap... | 39.504348 | 79 | 0.693374 | import os
import six
from absl import app
from absl import flags
from absl import logging
from six.moves import zip import numpy as np
import delta.compat as tf
FLAGS = flags.FLAGS
flags.DEFINE_string("checkpoints", "",
"Comma-separated list of checkpoints to average.")
flags.DEFINE_integer(
... | true | true |
f7185c76e2aade5c78a8e61bdc23ad067dcf6e03 | 1,742 | py | Python | src/compas/data/coercion.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | src/compas/data/coercion.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | src/compas/data/coercion.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from .validators import is_item_iterable
def coerce_sequence_of_tuple(sequence):
"""Make sure all items of a sequence are of type tuple.
Parameters
----------
sequence : sequence
A se... | 24.194444 | 72 | 0.584386 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from .validators import is_item_iterable
def coerce_sequence_of_tuple(sequence):
items = []
for item in sequence:
if not isinstance(item, tuple):
if not is_item_iterable(item):
... | true | true |
f7185d6f12e9bb7cb5506952d7aa10df068def6e | 1,777 | py | Python | ansible/lib/ansible/compat/six/__init__.py | kiv-box/redis | 966a0c3f0a51282cd173b42a6e249d23f4e89dec | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/compat/six/__init__.py | kiv-box/redis | 966a0c3f0a51282cd173b42a6e249d23f4e89dec | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/compat/six/__init__.py | kiv-box/redis | 966a0c3f0a51282cd173b42a6e249d23f4e89dec | [
"Apache-2.0"
] | null | null | null | # (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | 32.309091 | 77 | 0.702307 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
_BUNDLED_METADATA = { "pypi_name": "six", "version": "1.10.0" }
import os.path
try:
import six as _system_six
except ImportError:
_system_six = None
if _system_six:
if ( not hasattr(_system_s... | true | true |
f7185df1c90f20a4b94d48d8d0269d3b6a165204 | 278 | py | Python | run_trainer.py | yizhibaiwuya/LibFewShot | 3ce44c2fe61ee5e4074789aa165be461282c240b | [
"MIT"
] | null | null | null | run_trainer.py | yizhibaiwuya/LibFewShot | 3ce44c2fe61ee5e4074789aa165be461282c240b | [
"MIT"
] | null | null | null | run_trainer.py | yizhibaiwuya/LibFewShot | 3ce44c2fe61ee5e4074789aa165be461282c240b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
sys.dont_write_bytecode = True
from core.config import Config
from core import Trainer
if __name__ == "__main__":
config = Config("./config/negative_margin.yaml").get_config_dict()
trainer = Trainer(config)
trainer.train_loop()
| 21.384615 | 70 | 0.715827 | import sys
sys.dont_write_bytecode = True
from core.config import Config
from core import Trainer
if __name__ == "__main__":
config = Config("./config/negative_margin.yaml").get_config_dict()
trainer = Trainer(config)
trainer.train_loop()
| true | true |
f7185df3593f46979319b2f7f315cdd018a46131 | 6,853 | py | Python | preprocessing/extra_preprocessing.py | acp19tag/skill-extraction-dataset | fd188bda8a3aa17fbdf56958b7a8ff9e84099ba7 | [
"CC-BY-4.0"
] | null | null | null | preprocessing/extra_preprocessing.py | acp19tag/skill-extraction-dataset | fd188bda8a3aa17fbdf56958b7a8ff9e84099ba7 | [
"CC-BY-4.0"
] | null | null | null | preprocessing/extra_preprocessing.py | acp19tag/skill-extraction-dataset | fd188bda8a3aa17fbdf56958b7a8ff9e84099ba7 | [
"CC-BY-4.0"
] | null | null | null | #! /usr/bin/python3
"""
contains extra preprocessing steps for raw data, including:
- using regular expression to capture misclassified Skills in Experience class
- separating terms with special characters (e.g. '/', ',')
"""
from preprocessing.src.utils import * # pylint: disable=all
import re
import inflec... | 34.265 | 134 | 0.647454 |
from preprocessing.src.utils import * import re
import inflect import pandas as pd from pandas.core.common import SettingWithCopyWarning
from warnings import simplefilter
simplefilter(action='ignore', category=FutureWarning)
simplefilter(action='ignore', category=Setting... | true | true |
f7185df4c6e431a56ba7ff8190c50e11369902b6 | 3,027 | py | Python | app/app_3rdtry.py | TemsyChen/Spotifinder | b069ffcd63bd7654e1afd51cde3288c9678d121a | [
"MIT"
] | null | null | null | app/app_3rdtry.py | TemsyChen/Spotifinder | b069ffcd63bd7654e1afd51cde3288c9678d121a | [
"MIT"
] | null | null | null | app/app_3rdtry.py | TemsyChen/Spotifinder | b069ffcd63bd7654e1afd51cde3288c9678d121a | [
"MIT"
] | null | null | null | import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.express as px
from dash.dependencies import Input, Output
import pandas as pd
import pickle
# from os.path import dirname
# DIR = dirname(__file__)
# MODELS_DIR = DIR + '/../models/'
# DATA_DIR = DIR + '/../data/'
# data_... | 29.38835 | 107 | 0.645524 | import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.express as px
from dash.dependencies import Input, Output
import pandas as pd
import pickle
data_filename = r'C:\Users\temsy\Documents\GitHub\Spotifinder\data\NLP_songs_data.zip'
df = pd.read_csv(data_filename)
load... | true | true |
f7185efe2378f4b0a00acfbd3db707f8598d6702 | 11,532 | py | Python | github_explorer/main.py | michal-raska/github_explorer | aba3b059eaa06a78d4a0df34c2416e1f1e218d1d | [
"MIT"
] | null | null | null | github_explorer/main.py | michal-raska/github_explorer | aba3b059eaa06a78d4a0df34c2416e1f1e218d1d | [
"MIT"
] | null | null | null | github_explorer/main.py | michal-raska/github_explorer | aba3b059eaa06a78d4a0df34c2416e1f1e218d1d | [
"MIT"
] | null | null | null | import argparse
import getpass
import os
import re
import socket
from datetime import datetime
import github
from dateutil.relativedelta import relativedelta
from github import Github
from termcolor import colored
CHANGED_FILES_PAD = 50
STATE_OPEN = 'open'
STATE_MERGED = 'merged'
STATE_CLOSED = 'closed'
class Pull... | 36.0375 | 159 | 0.667881 | import argparse
import getpass
import os
import re
import socket
from datetime import datetime
import github
from dateutil.relativedelta import relativedelta
from github import Github
from termcolor import colored
CHANGED_FILES_PAD = 50
STATE_OPEN = 'open'
STATE_MERGED = 'merged'
STATE_CLOSED = 'closed'
class Pull... | true | true |
f71860515aa0c48a7527206271305a67a617026e | 5,375 | py | Python | entropylab/instruments/tests/test_qcodes_dummy.py | IgorQM/entropy | 8cbd3da356d8196e89eb9d810e643c80d6608481 | [
"BSD-3-Clause"
] | null | null | null | entropylab/instruments/tests/test_qcodes_dummy.py | IgorQM/entropy | 8cbd3da356d8196e89eb9d810e643c80d6608481 | [
"BSD-3-Clause"
] | null | null | null | entropylab/instruments/tests/test_qcodes_dummy.py | IgorQM/entropy | 8cbd3da356d8196e89eb9d810e643c80d6608481 | [
"BSD-3-Clause"
] | null | null | null | from typing import Optional, Dict, Any
import pytest
@pytest.mark.skip()
def test_qcodes_dummy():
from qcodes.instrument.base import InstrumentBase as qcodes_InstrumentBase
from entropylab.instruments.qcodes_adapter import QcodesAdapter
class MockQcodesDriver(qcodes_InstrumentBase):
d... | 33.59375 | 85 | 0.616744 | from typing import Optional, Dict, Any
import pytest
@pytest.mark.skip()
def test_qcodes_dummy():
from qcodes.instrument.base import InstrumentBase as qcodes_InstrumentBase
from entropylab.instruments.qcodes_adapter import QcodesAdapter
class MockQcodesDriver(qcodes_InstrumentBase):
d... | true | true |
f71860d421e7ec3d53fd94f7266b4caa0c5935a1 | 813 | py | Python | setup.py | iheartradio/all2vec | 1070655dc2b7df719ac8641616ab2a10b964d956 | [
"Apache-2.0"
] | 10 | 2016-08-11T20:25:45.000Z | 2017-05-04T14:10:19.000Z | setup.py | iheartradio/all2vec | 1070655dc2b7df719ac8641616ab2a10b964d956 | [
"Apache-2.0"
] | 11 | 2016-08-11T20:02:46.000Z | 2018-06-18T18:31:11.000Z | setup.py | iheartradio/all2vec | 1070655dc2b7df719ac8641616ab2a10b964d956 | [
"Apache-2.0"
] | 10 | 2016-08-11T19:45:17.000Z | 2019-04-24T22:07:30.000Z | from setuptools import setup, find_packages
setup(
name='all2vec',
version='0.6.0',
author='Ravi Mody, Jon Banafato',
author_email='datascience@iheartmedia.com',
description='Store and compare high dimensional vectors',
packages=find_packages(exclude=['tests']),
zip_safe=True,
install_... | 27.1 | 61 | 0.583026 | from setuptools import setup, find_packages
setup(
name='all2vec',
version='0.6.0',
author='Ravi Mody, Jon Banafato',
author_email='datascience@iheartmedia.com',
description='Store and compare high dimensional vectors',
packages=find_packages(exclude=['tests']),
zip_safe=True,
install_... | true | true |
f71861b294a65dddd71d9bdc515017b5fb0cd7fc | 738 | py | Python | kornia/__init__.py | Ishticode/kornia | 974abb43ec72d12dbd244a2fb247bbbab8498de0 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2022-03-15T02:24:30.000Z | 2022-03-15T02:24:30.000Z | kornia/__init__.py | Ishticode/kornia | 974abb43ec72d12dbd244a2fb247bbbab8498de0 | [
"ECL-2.0",
"Apache-2.0"
] | 14 | 2021-09-26T11:07:56.000Z | 2022-03-20T11:11:15.000Z | kornia/__init__.py | Ishticode/kornia | 974abb43ec72d12dbd244a2fb247bbbab8498de0 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-08-12T16:34:06.000Z | 2020-08-12T16:34:06.000Z | # import the version variable
from ._version import __version__
# NOTE: kornia filters and geometry must go first since are the core of the library
# and by changing the import order you might get into a circular dependencies issue.
from . import filters
from . import geometry
# import the other modules for convenien... | 22.363636 | 84 | 0.724932 | from ._version import __version__
from . import filters
from . import geometry
from . import (
augmentation,
color,
contrib,
enhance,
feature,
losses,
metrics,
morphology,
tracking,
utils,
x,
)
from kornia.constants import pi
from kornia.testing import xla_is_available
from... | true | true |
f71862fe1c337e03b7bd761bd77a93e15fb437ca | 3,490 | py | Python | plugins/powershell/komand_powershell/actions/powershell_string/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/powershell/komand_powershell/actions/powershell_string/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/powershell/komand_powershell/actions/powershell_string/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | import komand
from .schema import PowershellStringInput, PowershellStringOutput
# Custom imports below
from komand_powershell.util import util
class PowershellString(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="powershell_string",
description="Ex... | 31.441441 | 80 | 0.540974 | import komand
from .schema import PowershellStringInput, PowershellStringOutput
from komand_powershell.util import util
class PowershellString(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="powershell_string",
description="Execute PowerShell script... | true | true |
f718636819d7daacb6f2782f278cee37154f4006 | 38,114 | py | Python | flink-python/pyflink/datastream/state_backend.py | waychan23/flink | f4e2473f2a1a65b93537f2b03867683c35da85e1 | [
"Apache-2.0"
] | 2 | 2019-10-22T08:20:29.000Z | 2019-10-22T08:20:31.000Z | flink-python/pyflink/datastream/state_backend.py | waychan23/flink | f4e2473f2a1a65b93537f2b03867683c35da85e1 | [
"Apache-2.0"
] | 1 | 2020-05-19T08:20:26.000Z | 2020-05-19T08:20:26.000Z | flink-python/pyflink/datastream/state_backend.py | waychan23/flink | f4e2473f2a1a65b93537f2b03867683c35da85e1 | [
"Apache-2.0"
] | 1 | 2019-11-09T00:45:46.000Z | 2019-11-09T00:45:46.000Z | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 47.88191 | 99 | 0.690849 |
from abc import ABCMeta
from py4j.java_gateway import get_java_class
from pyflink.java_gateway import get_gateway
from pyflink.util.utils import load_java_class
__all__ = [
'StateBackend',
'MemoryStateBackend',
'FsStateBackend',
'RocksDBStateBackend',
'CustomStateBackend',
'PredefinedOptions... | true | true |
f71863ba6ce37bb3f9c1ddaa3068907ac1126cca | 347 | py | Python | line_chain/configs/__init__.py | smuelpeng/line-chain | 4b561fab001ff0cf15ac3b30d4bcf06f2ba92f0e | [
"MIT"
] | 1 | 2019-05-31T06:51:52.000Z | 2019-05-31T06:51:52.000Z | torch_basic_models/configs/__init__.py | FebruaryBreeze/torch-basic-models | ec819c93f7eee8cc99688cfe97bda12d1c55c5f3 | [
"MIT"
] | 1 | 2021-01-04T07:27:40.000Z | 2021-01-04T15:27:39.000Z | torch_basic_models/configs/__init__.py | FebruaryBreeze/torch-basic-models | ec819c93f7eee8cc99688cfe97bda12d1c55c5f3 | [
"MIT"
] | 2 | 2019-05-31T07:11:23.000Z | 2021-01-04T07:08:23.000Z | from pathlib import Path
import json_schema_to_class
current_dir: Path = Path(__file__).parent
json_schema_to_class.generate_dir(
schema_dir=current_dir.parent / 'schema',
output_dir=current_dir / 'build'
)
if __name__ != '__main__':
from .build import * # noqa: F403
del json_schema_to_class
de... | 20.411765 | 45 | 0.737752 | from pathlib import Path
import json_schema_to_class
current_dir: Path = Path(__file__).parent
json_schema_to_class.generate_dir(
schema_dir=current_dir.parent / 'schema',
output_dir=current_dir / 'build'
)
if __name__ != '__main__':
from .build import *
del json_schema_to_class
del current_dir... | true | true |
f71864d5160f3b67a35171531477e8a6ec7afbf2 | 543 | py | Python | test/test_add_contact.py | agaklo2/python_training | 2a2efcdd7b3c3043b6cade3f43c130a266b0d6c0 | [
"Apache-2.0"
] | null | null | null | test/test_add_contact.py | agaklo2/python_training | 2a2efcdd7b3c3043b6cade3f43c130a266b0d6c0 | [
"Apache-2.0"
] | null | null | null | test/test_add_contact.py | agaklo2/python_training | 2a2efcdd7b3c3043b6cade3f43c130a266b0d6c0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from model.contact import Contact
def test_add_contact(app, db, json_contacts, check_ui):
contact = json_contacts
old_contacts = db.get_contact_list()
app.contact.add_new_contact(contact)
new_contacts = db.get_contact_list()
old_contacts.append(contact)
assert sorted(ol... | 38.785714 | 123 | 0.745856 | from model.contact import Contact
def test_add_contact(app, db, json_contacts, check_ui):
contact = json_contacts
old_contacts = db.get_contact_list()
app.contact.add_new_contact(contact)
new_contacts = db.get_contact_list()
old_contacts.append(contact)
assert sorted(old_contacts, key=Contact.... | true | true |
f71864dca9bfab98675c8966d25abcbf121065d9 | 4,725 | py | Python | library/panos_lic.py | rtodto/ansible-pan | b38bfec1883b456a4188112605d24e0e170134f7 | [
"Apache-2.0"
] | 1 | 2019-04-19T23:08:27.000Z | 2019-04-19T23:08:27.000Z | library/panos_lic.py | rtodto/ansible-pan | b38bfec1883b456a4188112605d24e0e170134f7 | [
"Apache-2.0"
] | null | null | null | library/panos_lic.py | rtodto/ansible-pan | b38bfec1883b456a4188112605d24e0e170134f7 | [
"Apache-2.0"
] | 2 | 2019-01-31T02:51:08.000Z | 2020-09-03T15:45:52.000Z | #!/usr/bin/env python
# Copyright 2016 Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 27.47093 | 99 | 0.641905 |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: panos_lic
short_description: apply authcode to a device/instance
description:
- Apply an authcode to a device.
- The authcode should have ... | true | true |
f718673d1ce70cc80951a336ff5598237edaceba | 2,939 | py | Python | plotly/validators/bar/_error_y.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/bar/_error_y.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/bar/_error_y.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class ErrorYValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name='error_y', parent_name='bar', **kwargs):
super(ErrorYValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
d... | 40.819444 | 75 | 0.544403 | import _plotly_utils.basevalidators
class ErrorYValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name='error_y', parent_name='bar', **kwargs):
super(ErrorYValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
d... | true | true |
f71868a4b8ebf3789e41169b56a1d66e8c56afee | 3,995 | py | Python | tools/evo-plot/evo/tools/settings_template.py | jiexuan/evaluation_tools | d8cab5cea2c859ef6067aaedc8cf11be102ad7f8 | [
"MIT"
] | 12 | 2019-05-13T10:20:47.000Z | 2022-02-16T03:40:47.000Z | tools/evo-plot/evo/tools/settings_template.py | michaelczhou/evaluation_tools | 1ef3f6d65869990eb35b6e69106a77e0baf2c0b4 | [
"MIT"
] | null | null | null | tools/evo-plot/evo/tools/settings_template.py | michaelczhou/evaluation_tools | 1ef3f6d65869990eb35b6e69106a77e0baf2c0b4 | [
"MIT"
] | 7 | 2019-04-24T02:33:09.000Z | 2021-01-13T08:33:38.000Z | """
default package settings definition
author: Michael Grupp
This file is part of evo (github.com/MichaelGrupp/evo).
evo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at y... | 30.037594 | 90 | 0.617772 |
import pkgutil
def get_default_plot_backend():
backends = {"PyQt5": "Qt5Agg", "PyQt4": "Qt4Agg"}
for pkg in backends:
if pkgutil.find_loader(pkg) is not None:
return backends[pkg]
return "TkAgg"
DEFAULT_SETTINGS_DICT_DOC = {
"plot_xyz_realistic": (
True,
"Equal ... | true | true |
f718694017ecb8bcebe5c98f1ca749ae5c0352a5 | 24,505 | py | Python | lib-python/2.7/test/test_fractions.py | FloMom/pypy | d0cf0c5ed26a8b22a23b80779e5181a6bc9847c9 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | lib-python/2.7/test/test_fractions.py | FloMom/pypy | d0cf0c5ed26a8b22a23b80779e5181a6bc9847c9 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | lib-python/2.7/test/test_fractions.py | FloMom/pypy | d0cf0c5ed26a8b22a23b80779e5181a6bc9847c9 | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2021-10-10T13:53:32.000Z | 2021-10-10T13:53:32.000Z | """Tests for Lib/fractions.py."""
from decimal import Decimal
from test.test_support import run_unittest
import math
import numbers
import operator
import fractions
import unittest
from copy import copy, deepcopy
from cPickle import dumps, loads
F = fractions.Fraction
gcd = fractions.gcd
# decorator for skipping test... | 40.504132 | 79 | 0.574128 | """Tests for Lib/fractions.py."""
from decimal import Decimal
from test.test_support import run_unittest
import math
import numbers
import operator
import fractions
import unittest
from copy import copy, deepcopy
from cPickle import dumps, loads
F = fractions.Fraction
gcd = fractions.gcd
requires_IEEE_754 = unittest.... | false | true |
f718698cc99b9998bc182475d5ca68afff243272 | 46,449 | py | Python | external_apps/django-rosetta/rosetta/polib.py | spreeker/democracygame | 525139955cb739c295051f317ab670049511bcf8 | [
"BSD-3-Clause"
] | 2 | 2016-05-09T04:57:34.000Z | 2017-03-03T14:22:24.000Z | external_apps/django-rosetta/rosetta/polib.py | spreeker/democracygame | 525139955cb739c295051f317ab670049511bcf8 | [
"BSD-3-Clause"
] | null | null | null | external_apps/django-rosetta/rosetta/polib.py | spreeker/democracygame | 525139955cb739c295051f317ab670049511bcf8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# License: MIT (see LICENSE file provided)
# vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
"""
**polib** allows you to manipulate, create, modify gettext files (pot, po
and mo files). You can load existing files, iterate through it's entries,
add, modify entr... | 33.929145 | 155 | 0.534543 |
"""
**polib** allows you to manipulate, create, modify gettext files (pot, po
and mo files). You can load existing files, iterate through it's entries,
add, modify entries, comments or metadata, etc... or create new po files
from scratch.
**polib** provides a simple and pythonic API, exporting only three
convenience... | false | true |
f7186a787fb70368642bb14dc3fd2c4b8114cb16 | 16,032 | py | Python | tests/test_invoices.py | sm6xmm/epcon | 8bec4391f8a1fd234e644198a438c7613258655a | [
"BSD-2-Clause"
] | null | null | null | tests/test_invoices.py | sm6xmm/epcon | 8bec4391f8a1fd234e644198a438c7613258655a | [
"BSD-2-Clause"
] | null | null | null | tests/test_invoices.py | sm6xmm/epcon | 8bec4391f8a1fd234e644198a438c7613258655a | [
"BSD-2-Clause"
] | null | null | null | import csv
import decimal
from datetime import date, datetime
from decimal import Decimal
import random
import json
from django.http import QueryDict
from pytest import mark
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils import timezone
from django_factory_boy import ... | 34.403433 | 79 | 0.70141 | import csv
import decimal
from datetime import date, datetime
from decimal import Decimal
import random
import json
from django.http import QueryDict
from pytest import mark
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils import timezone
from django_factory_boy import ... | true | true |
f7186b0bfcb6fa0d28db71225539a73b5880267f | 1,277 | py | Python | panel/models.py | SebastinSanty/QuarkWebsite2017 | 30215f81d606e79820971edd91de4ab2ff95cc1f | [
"Apache-2.0"
] | 1 | 2016-12-19T09:42:44.000Z | 2016-12-19T09:42:44.000Z | panel/models.py | SebastinSanty/QuarkWebsite2017 | 30215f81d606e79820971edd91de4ab2ff95cc1f | [
"Apache-2.0"
] | 8 | 2016-12-29T08:08:43.000Z | 2017-01-28T18:11:47.000Z | panel/models.py | SebastinSanty/QuarkWebsite2017 | 30215f81d606e79820971edd91de4ab2ff95cc1f | [
"Apache-2.0"
] | 4 | 2016-12-21T12:51:33.000Z | 2017-07-21T07:06:05.000Z | from django.db import models
from django.contrib.auth.models import User
from django.db.models import signals
import registration
GENDER_CHOICES = (
(u'M',u'Male'),
(u'F',u'Female'),
(u'N',u"Don't wish to reveal")
)
YEAR_CHOICES = (
(u'U1',u'Undergraduate 1st year'),
(u'U2',u'Undergraduate 2nd year'),
(u'U3',... | 27.170213 | 74 | 0.723571 | from django.db import models
from django.contrib.auth.models import User
from django.db.models import signals
import registration
GENDER_CHOICES = (
(u'M',u'Male'),
(u'F',u'Female'),
(u'N',u"Don't wish to reveal")
)
YEAR_CHOICES = (
(u'U1',u'Undergraduate 1st year'),
(u'U2',u'Undergraduate 2nd year'),
(u'U3',... | true | true |
f7186b640388fb4012d907794b1497584c64f454 | 317 | py | Python | pandapipes/multinet/timeseries/__init__.py | e2nIEE/pandapipes | d7b5b91cf0a4dcdfdb255dadae6383d61385b802 | [
"BSD-3-Clause"
] | 48 | 2020-02-14T13:16:31.000Z | 2022-03-30T07:15:55.000Z | pandapipes/multinet/timeseries/__init__.py | e2nIEE/pandapipes | d7b5b91cf0a4dcdfdb255dadae6383d61385b802 | [
"BSD-3-Clause"
] | 279 | 2020-02-20T13:06:56.000Z | 2022-03-14T12:29:59.000Z | pandapipes/multinet/timeseries/__init__.py | e2nIEE/pandapipes | d7b5b91cf0a4dcdfdb255dadae6383d61385b802 | [
"BSD-3-Clause"
] | 30 | 2020-02-14T15:38:24.000Z | 2022-02-21T13:37:12.000Z | # Copyright (c) 2020-2021 by Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel, and University of Kassel. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
from .run_time_series_multinet import run_timeseries | 63.4 | 99 | 0.801262 |
from .run_time_series_multinet import run_timeseries | true | true |
f7186ba5ebfc513d05b9791631132efa31987d9a | 4,426 | py | Python | zoidbot_tools/src/zoidbot_tools/player.py | LCAS/zoidberg | 39599c053d6902a9f2252d510036af171ce5b899 | [
"MIT"
] | null | null | null | zoidbot_tools/src/zoidbot_tools/player.py | LCAS/zoidberg | 39599c053d6902a9f2252d510036af171ce5b899 | [
"MIT"
] | null | null | null | zoidbot_tools/src/zoidbot_tools/player.py | LCAS/zoidberg | 39599c053d6902a9f2252d510036af171ce5b899 | [
"MIT"
] | null | null | null | #!/usr/bin/python2
import sys
import os
from time import sleep
from threading import Timer
import rospy
import baxter_interface
from baxter_interface import CHECK_VERSION
class JointPlayer(object):
def __init__(self, filename, loops=1):
self.filename=filename
self.loops=loops
def t... | 34.850394 | 76 | 0.554677 |
import sys
import os
from time import sleep
from threading import Timer
import rospy
import baxter_interface
from baxter_interface import CHECK_VERSION
class JointPlayer(object):
def __init__(self, filename, loops=1):
self.filename=filename
self.loops=loops
def try_float(self, x):
... | true | true |
f7186bd3518a0b4de17b8aacb089858c3ed016c3 | 320 | py | Python | src.bak/const.py | amolabs/ecosim | b4aedc6496aa87facd357c9f153352bb68f42769 | [
"Apache-2.0"
] | 1 | 2022-01-05T02:10:37.000Z | 2022-01-05T02:10:37.000Z | src.bak/const.py | amolabs/ecosim | b4aedc6496aa87facd357c9f153352bb68f42769 | [
"Apache-2.0"
] | null | null | null | src.bak/const.py | amolabs/ecosim | b4aedc6496aa87facd357c9f153352bb68f42769 | [
"Apache-2.0"
] | null | null | null | # vim: set sw=4 ts=4 expandtab :
oneamo = 1000000000000000000
moteperamo = 1000000000000000000
DELTA_AMO = 0.000000001 # 10^-9 AMO
DELTA_MOTE = 1000000000 # 10^9 mote
BLKSHOUR = 60*60
BLKSDAY = 60*60*24
BLKSWEEK = 60*60*24*7
BLKSMONTH = 60*60*24*30
BLKSQUARTER = 60*60*24*90
BLKSYEAR = 60*60*24*365
| 21.333333 | 37 | 0.6875 |
oneamo = 1000000000000000000
moteperamo = 1000000000000000000
DELTA_AMO = 0.000000001 DELTA_MOTE = 1000000000 BLKSHOUR = 60*60
BLKSDAY = 60*60*24
BLKSWEEK = 60*60*24*7
BLKSMONTH = 60*60*24*30
BLKSQUARTER = 60*60*24*90
BLKSYEAR = 60*60*24*365
| true | true |
f7186c0ae96e4ece6c4d1bb8ccc4bbe0a86ebbb1 | 690 | py | Python | catalog/migrations/0007_auto_20210703_1655.py | l-a-motta/talehub | 970f27bda5625576cc66a5a31224adce031f7404 | [
"MIT"
] | null | null | null | catalog/migrations/0007_auto_20210703_1655.py | l-a-motta/talehub | 970f27bda5625576cc66a5a31224adce031f7404 | [
"MIT"
] | null | null | null | catalog/migrations/0007_auto_20210703_1655.py | l-a-motta/talehub | 970f27bda5625576cc66a5a31224adce031f7404 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-03 19:55
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('catalog', '0006_chapter_votes'),
]
operations = [
migrations.AddField(
model_name='book',
... | 25.555556 | 74 | 0.608696 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('catalog', '0006_chapter_votes'),
]
operations = [
migrations.AddField(
model_name='book',
name='published_at',
field=models... | true | true |
f7186c110ded7def9a81ed670b676696fc854c60 | 408 | py | Python | config/wsgi.py | SNFernandes24/church-ims | 944b7e65e926276adfe376ace01cf0adf135b954 | [
"MIT"
] | 1 | 2021-09-11T17:22:37.000Z | 2021-09-11T17:22:37.000Z | config/wsgi.py | SNFernandes24/church-ims | 944b7e65e926276adfe376ace01cf0adf135b954 | [
"MIT"
] | 39 | 2021-06-26T02:01:37.000Z | 2021-07-14T17:11:53.000Z | config/wsgi.py | SNFernandes24/church-ims | 944b7e65e926276adfe376ace01cf0adf135b954 | [
"MIT"
] | 2 | 2021-07-19T08:00:58.000Z | 2022-02-05T16:38:02.000Z | """
WSGI config for the Church IMS project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... | 24 | 78 | 0.786765 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
application = get_wsgi_application()
| true | true |
f7186c2877327744d960f3a5c9f0de88bb1a77e8 | 2,017 | py | Python | two-body-mond.py | alifianmahardhika/galaxy_simpy | 799d11b00a3b14991d89ddac0aabf0bcd447b800 | [
"Apache-2.0"
] | null | null | null | two-body-mond.py | alifianmahardhika/galaxy_simpy | 799d11b00a3b14991d89ddac0aabf0bcd447b800 | [
"Apache-2.0"
] | null | null | null | two-body-mond.py | alifianmahardhika/galaxy_simpy | 799d11b00a3b14991d89ddac0aabf0bcd447b800 | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
from numpy import sin,cos,pi,sqrt,exp,floor,zeros,copy,array
from numpy.random import normal
from numpy.linalg import norm
from random import uniform
from time import time
start = time()
def euler(x,v):
for i in range(n_particles):
sigmaF = zeros(2)
for j in range(n_... | 26.539474 | 70 | 0.57412 | import matplotlib.pyplot as plt
from numpy import sin,cos,pi,sqrt,exp,floor,zeros,copy,array
from numpy.random import normal
from numpy.linalg import norm
from random import uniform
from time import time
start = time()
def euler(x,v):
for i in range(n_particles):
sigmaF = zeros(2)
for j in range(n_... | true | true |
f7186c640d025037dc50ce370ed2fcdc2d73a4ac | 1,903 | py | Python | tests/examples/minlplib/tln2.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 2 | 2021-07-03T13:19:10.000Z | 2022-02-06T10:48:13.000Z | tests/examples/minlplib/tln2.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 1 | 2021-07-04T14:52:14.000Z | 2021-07-15T10:17:11.000Z | tests/examples/minlplib/tln2.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | null | null | null | # MINLP written by GAMS Convert at 04/21/18 13:54:54
#
# Equation counts
# Total E G L N X C B
# 13 1 0 12 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 32.254237 | 76 | 0.513925 |
from pyomo.environ import *
model = m = ConcreteModel()
m.b1 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b2 = Var(within=Binary,bounds=(0,1),initialize=0)
m.i3 = Var(within=Integers,bounds=(0,15),initialize=1)
m.i4 = Var(within=Integers,bounds=(0,15),initialize=1)
m.i5 = Var(within=Integers,bounds=(0,5),initi... | true | true |
f7186cbad53b1731dfb03dfb8d6594a4f2662ad1 | 1,124 | py | Python | setup.py | mr-bo-jangles/wagtail-metadata | 838c8d3329796575bad3986926419ee03a4ba073 | [
"BSD-3-Clause"
] | null | null | null | setup.py | mr-bo-jangles/wagtail-metadata | 838c8d3329796575bad3986926419ee03a4ba073 | [
"BSD-3-Clause"
] | null | null | null | setup.py | mr-bo-jangles/wagtail-metadata | 838c8d3329796575bad3986926419ee03a4ba073 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Install wagtail-metadata using setuptools
"""
from setuptools import find_packages, setup
with open('README.rst', 'r') as f:
readme = f.read()
setup(
name='wagtail-metadata',
version='2.0.0',
description="A tool to assist with metadata for social media.",
long_descriptio... | 26.139535 | 67 | 0.623665 |
from setuptools import find_packages, setup
with open('README.rst', 'r') as f:
readme = f.read()
setup(
name='wagtail-metadata',
version='2.0.0',
description="A tool to assist with metadata for social media.",
long_description=readme,
author='Liam Brenner',
author_email='liam@takeflight.c... | true | true |
f7186d02b626ff5fe789875170c8f2f71eaeb809 | 530 | py | Python | examples/volumetric/slicePlane2.py | leftwillow/vedo | b2e2cfc3453bbd118b6c81a2227b8ce6f1d22b7b | [
"CC0-1.0"
] | 1 | 2021-04-25T06:28:01.000Z | 2021-04-25T06:28:01.000Z | examples/volumetric/slicePlane2.py | leftwillow/vedo | b2e2cfc3453bbd118b6c81a2227b8ce6f1d22b7b | [
"CC0-1.0"
] | null | null | null | examples/volumetric/slicePlane2.py | leftwillow/vedo | b2e2cfc3453bbd118b6c81a2227b8ce6f1d22b7b | [
"CC0-1.0"
] | null | null | null | """Slice a Volume with multiple planes
Make low values of the scalar completely transparent"""
from vedo import *
vol = Volume(dataurl+'embryo.slc').alpha([0,0,0.5]).c('k')
slices = []
for i in range(4):
sl = vol.slicePlane(origin=[150,150,i*50+50], normal=(0,-1,1))
slices.append(sl)
amap = [0, 1, 1, 1, 1] ... | 31.176471 | 67 | 0.686792 | from vedo import *
vol = Volume(dataurl+'embryo.slc').alpha([0,0,0.5]).c('k')
slices = []
for i in range(4):
sl = vol.slicePlane(origin=[150,150,i*50+50], normal=(0,-1,1))
slices.append(sl)
amap = [0, 1, 1, 1, 1] mslices = merge(slices) mslices.cmap('hot_r', alpha=amap).lighting('off').addScalarBar3D()
sho... | true | true |
f7186e374732b0c52d8561de3f1a8eb7e950ff16 | 133,069 | py | Python | aesara/scan/op.py | sagartomar/aesara | 477f4e5dd757b1ccd3deaf59bf75fc27d7ab9cf6 | [
"BSD-3-Clause"
] | 1 | 2021-12-30T00:44:32.000Z | 2021-12-30T00:44:32.000Z | aesara/scan/op.py | sagartomar/aesara | 477f4e5dd757b1ccd3deaf59bf75fc27d7ab9cf6 | [
"BSD-3-Clause"
] | null | null | null | aesara/scan/op.py | sagartomar/aesara | 477f4e5dd757b1ccd3deaf59bf75fc27d7ab9cf6 | [
"BSD-3-Clause"
] | null | null | null | """This module provides the `Scan` `Op`.
Memory reuse in scan
--------------------
To reduce the number of memory allocations and copies associated with calling
the inner function and recovering the outputs at every iteration, Scan uses a
memory pre-allocation mechanism for some of its outputs. Instead of repeatedly
... | 42.190552 | 88 | 0.543936 |
import copy
import itertools
import logging
import time
from collections import OrderedDict
import numpy as np
import aesara
from aesara import tensor as aet
from aesara.compile.builders import infer_shape
from aesara.compile.function import function
from aesara.compile.io import In, Out
from aesara.compile.mode im... | true | true |
f7186e5afa113e54c0e28168f166b0ec2f0dcf61 | 2,842 | py | Python | src/meu_condominio/views/funcionario.py | lucasjoao/meu_condominio | aac37911384726b1aa1a40237050801a39174dc7 | [
"Unlicense"
] | null | null | null | src/meu_condominio/views/funcionario.py | lucasjoao/meu_condominio | aac37911384726b1aa1a40237050801a39174dc7 | [
"Unlicense"
] | null | null | null | src/meu_condominio/views/funcionario.py | lucasjoao/meu_condominio | aac37911384726b1aa1a40237050801a39174dc7 | [
"Unlicense"
] | null | null | null | # <controller>
# -*- coding: utf-8 -*-
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.contrib import messages
from meu_condominio.forms import *
from meu_condominio.models import Condominio, Funcionario
def funcionarios(requ... | 34.240964 | 76 | 0.683673 |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.contrib import messages
from meu_condominio.forms import *
from meu_condominio.models import Condominio, Funcionario
def funcionarios(request):
if request.user.is_authenticate... | true | true |
f7186e6d02c05356235e0949f257691e9716ebfa | 24,748 | py | Python | qa327_test/frontend/test_update_ticket.py | EricFillion/CMPE-327 | 5e9f7c0b083643f7b6b9702775f69f67863b395e | [
"MIT"
] | null | null | null | qa327_test/frontend/test_update_ticket.py | EricFillion/CMPE-327 | 5e9f7c0b083643f7b6b9702775f69f67863b395e | [
"MIT"
] | null | null | null | qa327_test/frontend/test_update_ticket.py | EricFillion/CMPE-327 | 5e9f7c0b083643f7b6b9702775f69f67863b395e | [
"MIT"
] | null | null | null | import pytest
from seleniumbase import BaseCase
from qa327_test.conftest import base_url
from unittest.mock import patch
from qa327_test.common import TEST_USER, TEST_TICKET, auto_login
from qa327.models import Ticket
from datetime import datetime
from qa327_test.conftest import base_url
"""
This file defines all unit... | 48.52549 | 188 | 0.694642 | import pytest
from seleniumbase import BaseCase
from qa327_test.conftest import base_url
from unittest.mock import patch
from qa327_test.common import TEST_USER, TEST_TICKET, auto_login
from qa327.models import Ticket
from datetime import datetime
from qa327_test.conftest import base_url
class FrontEndUpdateTicketTes... | true | true |
f7186fc46e644f635442d789ab4d0f721f98e6ea | 1,072 | py | Python | pythonLib/Evaluate_tool/test.py | BK-bokai/TW-SIM | 4e0bce9949919463af9d475b719a579b5e17c343 | [
"MIT"
] | null | null | null | pythonLib/Evaluate_tool/test.py | BK-bokai/TW-SIM | 4e0bce9949919463af9d475b719a579b5e17c343 | [
"MIT"
] | 4 | 2020-09-07T20:55:40.000Z | 2021-10-06T13:08:51.000Z | pythonLib/Evaluate_tool/test.py | BK-bokai/BK_WEB | 8c730e7fff54353768e19eeecb296c5435fd63b3 | [
"MIT"
] | null | null | null | import MySQLdb
import re, time
#connect() 方法用於建立資料庫的連線,裡面可以指定引數:使用者名稱,密碼,主機等資訊。
#這只是連線到了資料庫,要想操作資料庫需要建立遊標。
conn= MySQLdb.connect(
host='localhost',
port = 3306,
user='bokai',
passwd='2841p4204',
db ='tw_sim_evaluate',
)
#通過獲取到的資料庫連線conn下的cursor()方法來建立遊標。
cur = conn.curso... | 26.146341 | 124 | 0.646455 | import MySQLdb
import re, time
conn= MySQLdb.connect(
host='localhost',
port = 3306,
user='bokai',
passwd='2841p4204',
db ='tw_sim_evaluate',
)
cur = conn.cursor()
start = '2016-01-01'
end = '2016-01-31'
cur.execute("update met_evaluates set Finish='%d' where Time_Per... | true | true |
f7186ff31a042b4df78abd1eb0d664d671177e3a | 2,843 | py | Python | delete_empty_detection.py | ichiro-its/detection-utilities | 2c9ceba1a8e7e91e3c3c098dcf7bdf38f6d916b1 | [
"MIT"
] | null | null | null | delete_empty_detection.py | ichiro-its/detection-utilities | 2c9ceba1a8e7e91e3c3c098dcf7bdf38f6d916b1 | [
"MIT"
] | 1 | 2022-03-17T07:03:56.000Z | 2022-03-17T07:03:56.000Z | delete_empty_detection.py | ichiro-its/detection-utilities | 2c9ceba1a8e7e91e3c3c098dcf7bdf38f6d916b1 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 Ichiro ITS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribu... | 41.808824 | 82 | 0.653887 |
import argparse
import os
from tqdm import tqdm
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--data_path', help='path for image data',
type=str, default="data")
arg = parser.parse_args()
data_path = arg.data_path
for name in os.listdir(data_pat... | true | true |
f71870bca248e095ee9b2d951727e9f1124651d1 | 599 | py | Python | concoord/openreplica/testdnsport.py | liranz/concoord | bdb3798bf200d1cbd04bc50260cddaec6ba2a763 | [
"BSD-3-Clause"
] | 1 | 2016-04-07T11:28:55.000Z | 2016-04-07T11:28:55.000Z | concoord/openreplica/testdnsport.py | liranz/concoord | bdb3798bf200d1cbd04bc50260cddaec6ba2a763 | [
"BSD-3-Clause"
] | null | null | null | concoord/openreplica/testdnsport.py | liranz/concoord | bdb3798bf200d1cbd04bc50260cddaec6ba2a763 | [
"BSD-3-Clause"
] | null | null | null | '''
@author: Deniz Altinbuken, Emin Gun Sirer
@note: Script to check DNS Port bindings
@copyright: See LICENSE
'''
import socket
import sys
def testdnsport():
addr = 'localhost'
port = 53
thesocket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
thesocket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSE... | 23.96 | 65 | 0.706177 | import socket
import sys
def testdnsport():
addr = 'localhost'
port = 53
thesocket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
thesocket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
thesocket.setsockopt(socket.IPPROTO_TCP,socket.TCP_NODELAY,1)
thesocket.setblocking(0)
try:
... | true | true |
f71871ac74a5b36090da32aa41ca195d4a98b8ac | 4,274 | py | Python | wavepytools/optics/fourierOptics/exampleCircularLens2Steps.py | APS-XSD-OPT-Group/wavepytools | 25397c099e86a8939cc4ee3a2d266e4f809a1d18 | [
"MIT"
] | 3 | 2019-04-12T18:28:00.000Z | 2020-11-17T18:33:01.000Z | wavepytools/optics/fourierOptics/exampleCircularLens2Steps.py | APS-XSD-OPT-Group/wavepytools | 25397c099e86a8939cc4ee3a2d266e4f809a1d18 | [
"MIT"
] | null | null | null | wavepytools/optics/fourierOptics/exampleCircularLens2Steps.py | APS-XSD-OPT-Group/wavepytools | 25397c099e86a8939cc4ee3a2d266e4f809a1d18 | [
"MIT"
] | 3 | 2019-04-19T16:46:54.000Z | 2021-02-10T18:49:06.000Z | # -*- coding: utf-8 -*- #
"""
Created on Tue Mar 3 11:18:30 2015
@author: wcgrizolli
"""
import sys
import numpy as np
import matplotlib.pyplot as plt
from myFourierLib import *
sys.path.append('/home/wcgrizolli/pythonWorkspace/wgTools')
import wgTools as wgt
sys.path.append('/home/wcgrizolli/pythonWorkspace/... | 24.146893 | 83 | 0.494151 |
import sys
import numpy as np
import matplotlib.pyplot as plt
from myFourierLib import *
sys.path.append('/home/wcgrizolli/pythonWorkspace/wgTools')
import wgTools as wgt
sys.path.append('/home/wcgrizolli/pythonWorkspace/srw/wgTools4srw')
from wgTools4srw import *
wavelength = 1.2398e-9 [Lx, Ly] = [2.5e-3, 2.5... | true | true |
f71871b675be1af1cbe9148c90930e299463b8f0 | 10,314 | py | Python | src/busio.py | theacodes/Adafruit_Blinka | e89ea27c8b1db795949b3538dc10bec6117399ad | [
"MIT"
] | null | null | null | src/busio.py | theacodes/Adafruit_Blinka | e89ea27c8b1db795949b3538dc10bec6117399ad | [
"MIT"
] | null | null | null | src/busio.py | theacodes/Adafruit_Blinka | e89ea27c8b1db795949b3538dc10bec6117399ad | [
"MIT"
] | null | null | null | """
`busio` - Bus protocol support like I2C and SPI
=================================================
See `CircuitPython:busio` in CircuitPython for more details.
* Author(s): cefn
"""
import threading
from adafruit_blinka import Enum, Lockable, agnostic
from adafruit_blinka.agnostic import board_id, detector
impor... | 40.132296 | 135 | 0.610432 |
import threading
from adafruit_blinka import Enum, Lockable, agnostic
from adafruit_blinka.agnostic import board_id, detector
import adafruit_platformdetect.board as ap_board
class I2C(Lockable):
def __init__(self, scl, sda, frequency=400000):
self.init(scl, sda, frequency)
def init(self, scl, sda, ... | true | true |
f71874666f031e2f40b1def6bb96f40e949bdb3b | 2,497 | py | Python | pytorch_toolbelt/modules/encoders/timm/common.py | George-Jiao/pytorch-toolbelt | 920e03876805351ed5645e439a64074cb4f37589 | [
"MIT"
] | 1 | 2021-08-18T07:05:50.000Z | 2021-08-18T07:05:50.000Z | pytorch_toolbelt/modules/encoders/timm/common.py | George-Jiao/pytorch-toolbelt | 920e03876805351ed5645e439a64074cb4f37589 | [
"MIT"
] | null | null | null | pytorch_toolbelt/modules/encoders/timm/common.py | George-Jiao/pytorch-toolbelt | 920e03876805351ed5645e439a64074cb4f37589 | [
"MIT"
] | null | null | null | import math
import warnings
import torch
from typing import List, Union
from torch import Tensor, nn
from ..common import EncoderModule, _take
__all__ = ["GenericTimmEncoder", "make_n_channel_input_std_conv"]
class GenericTimmEncoder(EncoderModule):
def __init__(self, timm_encoder: Union[nn.Module, str], layer... | 32.012821 | 105 | 0.647177 | import math
import warnings
import torch
from typing import List, Union
from torch import Tensor, nn
from ..common import EncoderModule, _take
__all__ = ["GenericTimmEncoder", "make_n_channel_input_std_conv"]
class GenericTimmEncoder(EncoderModule):
def __init__(self, timm_encoder: Union[nn.Module, str], layer... | true | true |
f71874cba60460437882bdc45ed1583f94262ca5 | 1,184 | py | Python | go.py | goldtime1987/pyQTGraph | 0ab1e341907f791c21980dbf3ea79b15977a0e33 | [
"MIT"
] | 238 | 2016-07-31T16:11:22.000Z | 2022-03-25T19:20:56.000Z | 2016-07-31_qt_PyQtGraph_sine_scroll/go.py | jradler-wassoc/Python-GUI-examples | 97193758d9f8f57f304f95959403f1db84c3c0b0 | [
"MIT"
] | 12 | 2016-11-07T17:22:50.000Z | 2020-07-09T14:39:48.000Z | 2016-07-31_qt_PyQtGraph_sine_scroll/go.py | jradler-wassoc/Python-GUI-examples | 97193758d9f8f57f304f95959403f1db84c3c0b0 | [
"MIT"
] | 191 | 2016-08-10T01:44:51.000Z | 2022-01-03T01:39:08.000Z | from PyQt4 import QtGui,QtCore
import sys
import ui_main
import numpy as np
import pylab
import time
import pyqtgraph
class ExampleApp(QtGui.QMainWindow, ui_main.Ui_MainWindow):
def __init__(self, parent=None):
pyqtgraph.setConfigOption('background', 'w') #before loading widget
super(Exa... | 33.828571 | 76 | 0.643581 | from PyQt4 import QtGui,QtCore
import sys
import ui_main
import numpy as np
import pylab
import time
import pyqtgraph
class ExampleApp(QtGui.QMainWindow, ui_main.Ui_MainWindow):
def __init__(self, parent=None):
pyqtgraph.setConfigOption('background', 'w') super(ExampleApp, self).__init__(... | true | true |
f71874e9bbb685b97aee7b1ea9ac4bc50e8a3bfc | 11,660 | py | Python | cinder/tests/unit/api/contrib/test_volume_replication.py | rackerlabs/cinder | 4295ff0a64f781c3546f6c6e0816dbb8100133cb | [
"Apache-2.0"
] | 1 | 2019-02-08T05:24:58.000Z | 2019-02-08T05:24:58.000Z | cinder/tests/unit/api/contrib/test_volume_replication.py | rackerlabs/cinder | 4295ff0a64f781c3546f6c6e0816dbb8100133cb | [
"Apache-2.0"
] | 1 | 2021-03-21T11:38:29.000Z | 2021-03-21T11:38:29.000Z | cinder/tests/unit/api/contrib/test_volume_replication.py | rackerlabs/cinder | 4295ff0a64f781c3546f6c6e0816dbb8100133cb | [
"Apache-2.0"
] | 15 | 2017-01-12T10:35:10.000Z | 2019-04-19T08:22:10.000Z | # Copyright 2014 IBM Corp.
#
# 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 t... | 47.206478 | 78 | 0.513722 |
import json
import mock
from oslo_config import cfg
import webob
from cinder import context
from cinder import test
from cinder.tests.unit.api import fakes
from cinder.tests.unit import utils as tests_utils
CONF = cfg.CONF
def app():
api = fakes.router.APIRouter()
mapper = fakes.urlmap.URLMap()
m... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.