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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f768acd4e6e538570af1d2b028a990a78a4e8630 | 11,533 | py | Python | mining_system.py | SAKETplayZzz/PyCraft-official | 6e64874d1d40b2a3262bff908d459ade64388ca0 | [
"MIT"
] | 1 | 2021-09-25T02:21:48.000Z | 2021-09-25T02:21:48.000Z | mining_system.py | SAKETplayZzz/PyCraft-official | 6e64874d1d40b2a3262bff908d459ade64388ca0 | [
"MIT"
] | null | null | null | mining_system.py | SAKETplayZzz/PyCraft-official | 6e64874d1d40b2a3262bff908d459ade64388ca0 | [
"MIT"
] | null | null | null | """
Build tool system for mining and building :)
Good luck!
"""
from random import randrange, randint, random
from ursina import Entity, color, texture, Vec3
from numpy import floor
class Mining_system:
def __init__(this, _subject, _camera, _subsets):
# distance of build (Thanks, Ethan!)
this.bui... | 36.612698 | 71 | 0.455562 |
from random import randrange, randint, random
from ursina import Entity, color, texture, Vec3
from numpy import floor
class Mining_system:
def __init__(this, _subject, _camera, _subsets):
this.build_distance = 3
this.buildMode = -1
this.blockTypes = []
... | true | true |
f768ad64727310ebb396b3c6ae9b3ec9de4176ad | 1,760 | py | Python | run_create_imagebuilder_iam.py | HardBoiledSmith/johanna | 0443a9040f0248f0a800c9d4b062e375f997bb6f | [
"MIT"
] | 64 | 2016-11-03T11:20:25.000Z | 2021-05-24T03:08:57.000Z | run_create_imagebuilder_iam.py | HardBoiledSmith/johanna | 0443a9040f0248f0a800c9d4b062e375f997bb6f | [
"MIT"
] | 69 | 2016-11-03T14:09:35.000Z | 2022-02-07T12:52:05.000Z | run_create_imagebuilder_iam.py | HardBoiledSmith/johanna | 0443a9040f0248f0a800c9d4b062e375f997bb6f | [
"MIT"
] | 19 | 2016-11-03T11:04:51.000Z | 2020-06-12T10:40:57.000Z | #!/usr/bin/env python3
from run_common import AWSCli
import json
import time
aws_cli = AWSCli()
def create_iam_profile_for_imagebuilder(name):
profile_name = f'aws-imagebuilder-{name}-instance-profile'
role_name = 'aws-imagebuilder-role'
cmd = ['iam', 'get-instance-profile']
cmd += ['--instance-pro... | 30.344828 | 106 | 0.632955 |
from run_common import AWSCli
import json
import time
aws_cli = AWSCli()
def create_iam_profile_for_imagebuilder(name):
profile_name = f'aws-imagebuilder-{name}-instance-profile'
role_name = 'aws-imagebuilder-role'
cmd = ['iam', 'get-instance-profile']
cmd += ['--instance-profile-name', profile_nam... | true | true |
f768ada5efdae3f00e1abddaa4bf5fdc5844ceab | 127 | py | Python | src/Dominion/Victorycards/Gardens.py | CarlGathmann/Dominion | dc30a6db5f005d1148c5ddb4346a8d2b4397001c | [
"MIT"
] | null | null | null | src/Dominion/Victorycards/Gardens.py | CarlGathmann/Dominion | dc30a6db5f005d1148c5ddb4346a8d2b4397001c | [
"MIT"
] | null | null | null | src/Dominion/Victorycards/Gardens.py | CarlGathmann/Dominion | dc30a6db5f005d1148c5ddb4346a8d2b4397001c | [
"MIT"
] | null | null | null | from src.Dominion.Cardtypes.Victorycard import Victorycard
class Gardens(Victorycard):
EXPENCES = 4
VICTORYPOINTS = 0 | 21.166667 | 58 | 0.771654 | from src.Dominion.Cardtypes.Victorycard import Victorycard
class Gardens(Victorycard):
EXPENCES = 4
VICTORYPOINTS = 0 | true | true |
f768adf6dfa4c1f2b8f18ed2a178b0d406ed4553 | 12,764 | py | Python | pyglet/lib.py | SwineProject/pyglet | f0203870bef94d4349ad16f060c941d45270a0b5 | [
"BSD-3-Clause"
] | null | null | null | pyglet/lib.py | SwineProject/pyglet | f0203870bef94d4349ad16f060c941d45270a0b5 | [
"BSD-3-Clause"
] | null | null | null | pyglet/lib.py | SwineProject/pyglet | f0203870bef94d4349ad16f060c941d45270a0b5 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2018 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | 35.259669 | 155 | 0.601065 | from __future__ import print_function
from builtins import object, str
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import os
import re
import sys
import ctypes
import ctypes.util
import pyglet
_debug_lib = pyglet.options['debug_lib']
_debug_trace = pyglet.options['debug_trace']
_is_epydoc = hasattr(... | true | true |
f768ae1e496e1c3ec72bd815781d3b1b7238066a | 825 | py | Python | pygears/typing_common/factor.py | Risto97/pygears | 19393e85101a16762cb3bbbf3010946ef69217f2 | [
"MIT"
] | null | null | null | pygears/typing_common/factor.py | Risto97/pygears | 19393e85101a16762cb3bbbf3010946ef69217f2 | [
"MIT"
] | null | null | null | pygears/typing_common/factor.py | Risto97/pygears | 19393e85101a16762cb3bbbf3010946ef69217f2 | [
"MIT"
] | null | null | null | from pygears.conf import safe_bind
from pygears.typing import TypingNamespacePlugin, Queue, Tuple, Union, typeof
def factor(type_):
if typeof(type_, Union):
for t in type_.types:
if not typeof(t, Queue):
return type_
else:
union_types = []
for t ... | 28.448276 | 77 | 0.592727 | from pygears.conf import safe_bind
from pygears.typing import TypingNamespacePlugin, Queue, Tuple, Union, typeof
def factor(type_):
if typeof(type_, Union):
for t in type_.types:
if not typeof(t, Queue):
return type_
else:
union_types = []
for t ... | true | true |
f768aea4d4011f73b1184fb85b147acccbe522d2 | 24,858 | py | Python | tools/getAllDatav2.py | bIoTopeH2020project/O-MI | 86d074fb33b0f57fc6bd04a16ad21852dd764a61 | [
"BSD-4-Clause"
] | 25 | 2015-11-19T12:35:38.000Z | 2021-11-07T20:38:03.000Z | tools/getAllDatav2.py | bIoTopeH2020project/O-MI | 86d074fb33b0f57fc6bd04a16ad21852dd764a61 | [
"BSD-4-Clause"
] | 22 | 2016-01-28T14:17:42.000Z | 2019-08-26T21:07:13.000Z | tools/getAllDatav2.py | SnowblindFatal/Code-Gardeners | 9fa603556e0cf2dc9ed041bf5822837c95b99daa | [
"BSD-4-Clause"
] | 15 | 2015-11-11T10:17:25.000Z | 2019-05-24T19:37:58.000Z | #!/usr/bin/python3
import sys, os, argparse, re, functools, pathlib, gzip
from requests import Session
from copy import deepcopy
#import websocket
def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs)
def noprint(*args, **kwargs): pass
try:
from lxml import etree
except ImportError:
eprint("ERR... | 44.152753 | 190 | 0.552056 | import sys, os, argparse, re, functools, pathlib, gzip
from requests import Session
from copy import deepcopy
def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs)
def noprint(*args, **kwargs): pass
try:
from lxml import etree
except ImportError:
eprint("ERROR: missing lxml library; Try `pip3 i... | true | true |
f768af25b6c0c357042f52adc9bc4bbd6765fd52 | 350 | py | Python | take_home/users/urls.py | SUPERVISA-AI/take-home-backend | d71025b533619de3f6f1611dc18ef29a762b8cf0 | [
"MIT"
] | null | null | null | take_home/users/urls.py | SUPERVISA-AI/take-home-backend | d71025b533619de3f6f1611dc18ef29a762b8cf0 | [
"MIT"
] | 1 | 2022-03-30T20:13:47.000Z | 2022-03-30T20:13:47.000Z | take_home/users/urls.py | SUPERVISA-AI/take-home-backend | d71025b533619de3f6f1611dc18ef29a762b8cf0 | [
"MIT"
] | null | null | null | from django.urls import path
from take_home.users.views import user_detail_view, user_redirect_view, user_update_view
app_name = "users"
urlpatterns = [
path("~redirect/", view=user_redirect_view, name="redirect"),
path("~update/", view=user_update_view, name="update"),
path("<str:username>/", view=user_d... | 31.818182 | 88 | 0.737143 | from django.urls import path
from take_home.users.views import user_detail_view, user_redirect_view, user_update_view
app_name = "users"
urlpatterns = [
path("~redirect/", view=user_redirect_view, name="redirect"),
path("~update/", view=user_update_view, name="update"),
path("<str:username>/", view=user_d... | true | true |
f768afd54a4e168d343216b6fea53a87b70b36f3 | 789 | py | Python | app/public_api/migrations/0001_initial.py | ozanteoman/python-django-project-in-docker | d619f455e40df5d6c4ad67d8b22e34a9b41b5401 | [
"MIT"
] | 1 | 2019-09-14T00:18:24.000Z | 2019-09-14T00:18:24.000Z | app/public_api/migrations/0001_initial.py | ozanteoman/python-django-project-in-docker | d619f455e40df5d6c4ad67d8b22e34a9b41b5401 | [
"MIT"
] | 1 | 2021-06-02T00:27:40.000Z | 2021-06-02T00:27:40.000Z | app/public_api/migrations/0001_initial.py | ozanteoman/python-django-project-in-docker | d619f455e40df5d6c4ad67d8b22e34a9b41b5401 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2019-09-13 19:52
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 29.222222 | 118 | 0.627376 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
f768b0cc8cd48211c952ac03f85a97af28305206 | 28,565 | py | Python | utils/data.py | WEYAI/NCRFpp | c205e742a674bbacea9f5047cfb03b396c50264b | [
"Apache-2.0"
] | null | null | null | utils/data.py | WEYAI/NCRFpp | c205e742a674bbacea9f5047cfb03b396c50264b | [
"Apache-2.0"
] | null | null | null | utils/data.py | WEYAI/NCRFpp | c205e742a674bbacea9f5047cfb03b396c50264b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author: Jie
# @Date: 2017-06-14 17:34:32
# @Last Modified by: Jie Yang, Contact: jieynlp@gmail.com
# @Last Modified time: 2019-01-25 20:25:59
from __future__ import print_function
from __future__ import absolute_import
import argparse
import sys
import os
import torch
os.chdir(sys.pat... | 41.82284 | 313 | 0.590443 | from __future__ import print_function
from __future__ import absolute_import
import argparse
import sys
import os
import torch
os.chdir(sys.path[0])
sys.path.append("../../")
sys.path.append("../../../")
sys.path.append("../")
from utils.alphabet import Alphabet
from utils.functions import *
try:
import cPickle as... | true | true |
f768b1518c5d842b5e16e490771bc8120f866284 | 1,202 | py | Python | greengraph/cmd.py | stiebels/MPHYG001_assignment-1 | 4c786f2cd18839cb33ca1ea0ba8ac9fd19a7bf33 | [
"MIT"
] | null | null | null | greengraph/cmd.py | stiebels/MPHYG001_assignment-1 | 4c786f2cd18839cb33ca1ea0ba8ac9fd19a7bf33 | [
"MIT"
] | null | null | null | greengraph/cmd.py | stiebels/MPHYG001_assignment-1 | 4c786f2cd18839cb33ca1ea0ba8ac9fd19a7bf33 | [
"MIT"
] | null | null | null | from argparse import ArgumentParser
from matplotlib import pyplot as plt
from greengraph.Graph import Graph
'''
This class implements the command line interface.
'''
def runModule():
parser = ArgumentParser(description='Generates a graph that displays the number of green pixels per step between two geographical l... | 37.5625 | 223 | 0.704659 | from argparse import ArgumentParser
from matplotlib import pyplot as plt
from greengraph.Graph import Graph
def runModule():
parser = ArgumentParser(description='Generates a graph that displays the number of green pixels per step between two geographical locations.')
parser.add_argument(dest='begin', help='En... | true | true |
f768b277c3322279af10aed84bca4e8a778aa5b8 | 2,303 | py | Python | order/migrations/0001_initial.py | doctsystems/jaguarete-ecommerce | 89e3868885297c13e77c02093fdc5aefa2a2a827 | [
"MIT"
] | null | null | null | order/migrations/0001_initial.py | doctsystems/jaguarete-ecommerce | 89e3868885297c13e77c02093fdc5aefa2a2a827 | [
"MIT"
] | null | null | null | order/migrations/0001_initial.py | doctsystems/jaguarete-ecommerce | 89e3868885297c13e77c02093fdc5aefa2a2a827 | [
"MIT"
] | 1 | 2021-07-01T17:09:10.000Z | 2021-07-01T17:09:10.000Z | # Generated by Django 3.2.4 on 2021-07-02 02:26
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('producto', '0003_al... | 47.979167 | 162 | 0.633956 |
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('producto', '0003_alter_producto_options'),
]
operations = ... | true | true |
f768b297e88ef57cf27229e35ff04c07827b5e71 | 6,385 | py | Python | mppi/Parsers/YamboOutputParser.py | marcodalessandro76/MPPI | ad60b73270b1f376ac501d47285146f1c3af457a | [
"MIT"
] | 1 | 2019-05-04T09:26:36.000Z | 2019-05-04T09:26:36.000Z | mppi/Parsers/YamboOutputParser.py | marcodalessandro76/MPPI | ad60b73270b1f376ac501d47285146f1c3af457a | [
"MIT"
] | null | null | null | mppi/Parsers/YamboOutputParser.py | marcodalessandro76/MPPI | ad60b73270b1f376ac501d47285146f1c3af457a | [
"MIT"
] | null | null | null | """
Module that manages the parsing of a Yambo o- file(s).
"""
import numpy as np
# Specifies the name of the columns of the o- files for various type of runs. There are
# two distint dictionaries depending if the ExtendOut option has been activated or not.
# The rt outputs are not modified by the extendOut option
r... | 36.485714 | 117 | 0.644009 |
import numpy as np
rt_column_names = {
'carriers' : ['time','dnhmne','dnh','dne'],
'currents' : ['time','j_x','j_y','j_z'],
'polarization' : ['time','Pol_x','Pol_y','Pol_z'],
'spin_magnetization' :
['time','Ms_x','Ms_y','Ms_z','Mv_x','Mv_y','Mv_z','Mc_x','Mc_y','Mc_z'],
'orb_magnetization... | true | true |
f768b2ca322d4e78fa62328b5ac2e112c9994a44 | 16,281 | py | Python | torch_utils/ops/upfirdn2d.py | gregjauvion/stylegan2-ada | f6ef72305212b42f42d179b2a4b6d4629b14a4fd | [
"BSD-Source-Code"
] | 153 | 2021-02-08T16:30:00.000Z | 2022-02-28T15:47:23.000Z | torch_utils/ops/upfirdn2d.py | gregjauvion/stylegan2-ada | f6ef72305212b42f42d179b2a4b6d4629b14a4fd | [
"BSD-Source-Code"
] | 16 | 2021-03-19T07:08:04.000Z | 2022-03-31T17:35:59.000Z | torch_utils/ops/upfirdn2d.py | gregjauvion/stylegan2-ada | f6ef72305212b42f42d179b2a4b6d4629b14a4fd | [
"BSD-Source-Code"
] | 22 | 2021-02-10T10:45:31.000Z | 2022-01-24T02:55:03.000Z | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and rel... | 42.288312 | 157 | 0.578036 |
import os
import sys
import warnings
import numpy as np
import torch
from .. import custom_ops
from .. import misc
from . import conv2d_gradfix
_inited = False
_plugin = None
def _init():
global _inited, _plugin
if not _inited:
sources = ['upfirdn2d.cpp', 'upfirdn2d.cu']
sources = [os.path... | true | true |
f768b41897e4409f1a1dcff1cc41832f04e3f810 | 2,678 | py | Python | contractions/__init__.py | outwrite/contractions | 763ab2ec9ec0a19aa3a6209393fa771dfda04d3a | [
"MIT"
] | null | null | null | contractions/__init__.py | outwrite/contractions | 763ab2ec9ec0a19aa3a6209393fa771dfda04d3a | [
"MIT"
] | null | null | null | contractions/__init__.py | outwrite/contractions | 763ab2ec9ec0a19aa3a6209393fa771dfda04d3a | [
"MIT"
] | null | null | null | from itertools import product
from textsearch import TextSearch
import json
import pkgutil
json_open = pkgutil.get_data("contractions", "data/contractions_dict.json")
contractions_dict = json.loads(json_open.decode("utf-8"))
json_open = pkgutil.get_data("contractions", "data/leftovers_dict.json")
leftovers_dict = js... | 25.028037 | 94 | 0.663928 | from itertools import product
from textsearch import TextSearch
import json
import pkgutil
json_open = pkgutil.get_data("contractions", "data/contractions_dict.json")
contractions_dict = json.loads(json_open.decode("utf-8"))
json_open = pkgutil.get_data("contractions", "data/leftovers_dict.json")
leftovers_dict = js... | true | true |
f768b51f10143ca5cc70f573e95f7d194a378c6e | 5,417 | py | Python | tests/unit/testOAuth2AuthorizationCodeGrant.py | Abestanis/TwistedOAuth2 | fc1d9401009610084189afe48bd8df4db933c825 | [
"MIT"
] | 3 | 2017-12-07T18:06:42.000Z | 2018-11-09T10:31:45.000Z | tests/unit/testOAuth2AuthorizationCodeGrant.py | Abestanis/TwistedOAuth2 | fc1d9401009610084189afe48bd8df4db933c825 | [
"MIT"
] | 1 | 2018-10-15T23:55:15.000Z | 2018-10-16T03:37:10.000Z | tests/unit/testOAuth2AuthorizationCodeGrant.py | Abestanis/TwistedOAuth2 | fc1d9401009610084189afe48bd8df4db933c825 | [
"MIT"
] | 1 | 2017-12-11T16:20:39.000Z | 2017-12-11T16:20:39.000Z | """ Tests for the authorization resource side of the authorization code grant flow. """
from txoauth2 import GrantTypes
from tests import MockRequest
from tests.unit.testGrant import Abstract
class TestAuthorizationCodeGrant(Abstract.SharedGrantTest):
"""
Test the authorization resource part of the Authoriz... | 54.17 | 98 | 0.620639 |
from txoauth2 import GrantTypes
from tests import MockRequest
from tests.unit.testGrant import Abstract
class TestAuthorizationCodeGrant(Abstract.SharedGrantTest):
_RESPONSE_TYPE = 'code'
def assertValidCodeResponse(self, request, result, data, msg, expectedAdditionalData=None,
... | true | true |
f768b59b757ac537f1eb1f369d4f682c316e91ce | 434,856 | py | Python | ibm_watson/speech_to_text_v1.py | johann-petrak/python-sdk | e8a2f1883822f0ad2d655d31a595dbd93f5c81c9 | [
"Apache-2.0"
] | 1,579 | 2015-10-08T14:02:17.000Z | 2022-02-28T10:49:21.000Z | ibm_watson/speech_to_text_v1.py | johann-petrak/python-sdk | e8a2f1883822f0ad2d655d31a595dbd93f5c81c9 | [
"Apache-2.0"
] | 749 | 2015-10-08T20:00:24.000Z | 2022-03-21T21:33:17.000Z | ibm_watson/speech_to_text_v1.py | johann-petrak/python-sdk | e8a2f1883822f0ad2d655d31a595dbd93f5c81c9 | [
"Apache-2.0"
] | 1,006 | 2015-10-24T06:30:58.000Z | 2022-03-23T07:10:04.000Z | # coding: utf-8
# (C) Copyright IBM Corp. 2015, 2021.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 52.010047 | 137 | 0.639113 |
from enum import Enum
from typing import BinaryIO, Dict, List, TextIO, Union
import json
from ibm_cloud_sdk_core import BaseService, DetailedResponse
from ibm_cloud_sdk_core.authenticators.authenticator import Authenticator
from ibm_cloud_sdk_core.get_authenticator import get_authenticator_from_environment
from ibm... | true | true |
f768b5b0a6d58c1429721d4054281e27033893dd | 27,737 | py | Python | src/CADRE/attitude.py | JustinSGray/OpenMDAO-CADRE | d8378a8a571179990531d8a409efe727cbdf2bb7 | [
"Apache-2.0"
] | 1 | 2021-07-11T19:15:22.000Z | 2021-07-11T19:15:22.000Z | src/CADRE/attitude.py | JustinSGray/OpenMDAO-CADRE | d8378a8a571179990531d8a409efe727cbdf2bb7 | [
"Apache-2.0"
] | null | null | null | src/CADRE/attitude.py | JustinSGray/OpenMDAO-CADRE | d8378a8a571179990531d8a409efe727cbdf2bb7 | [
"Apache-2.0"
] | 1 | 2015-11-19T18:18:01.000Z | 2015-11-19T18:18:01.000Z | ''' Attitude discipline for CADRE '''
import numpy as np
from openmdao.lib.datatypes.api import Float, Array
from openmdao.main.api import Component
from CADRE.kinematics import computepositionrotd, computepositionrotdjacobian
# Allow non-standard variable names for scientific calc
# pylint: disable-msg=C0103
cla... | 35.928756 | 138 | 0.420233 |
import numpy as np
from openmdao.lib.datatypes.api import Float, Array
from openmdao.main.api import Component
from CADRE.kinematics import computepositionrotd, computepositionrotdjacobian
class Attitude_Angular(Component):
def __init__(self, n=2):
super(Attitude_Angular, self).__init__()
s... | true | true |
f768b5cab14bb8fcfb9548d7ac20073a9d5192ca | 3,999 | py | Python | Thesis@3.9.1/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | Thesis@3.9.1/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | Thesis@3.9.1/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | import json
import logging
from pip._internal.models.direct_url import (
DIRECT_URL_METADATA_NAME,
ArchiveInfo,
DirectUrl,
DirectUrlValidationError,
DirInfo,
VcsInfo,
)
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
from pip._internal.vcs import vcs
if MYPY_CHECK_RUNNING:
from t... | 33.889831 | 85 | 0.643911 | import json
import logging
from pip._internal.models.direct_url import (
DIRECT_URL_METADATA_NAME,
ArchiveInfo,
DirectUrl,
DirectUrlValidationError,
DirInfo,
VcsInfo,
)
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
from pip._internal.vcs import vcs
if MYPY_CHECK_RUNNING:
from t... | true | true |
f768b61080c8112059c9daec1c6b2de0cd985c95 | 1,387 | py | Python | setup.py | shoaibmahmod7/Turbomachinery-Rotors-Balancing | 8bb4c1ec97c4646bcd69ed3398aafc7f985bc96d | [
"MIT"
] | 1 | 2022-02-03T17:14:16.000Z | 2022-02-03T17:14:16.000Z | setup.py | shoaibmahmod7/Turbomachinery-Rotors-Balancing | 8bb4c1ec97c4646bcd69ed3398aafc7f985bc96d | [
"MIT"
] | null | null | null | setup.py | shoaibmahmod7/Turbomachinery-Rotors-Balancing | 8bb4c1ec97c4646bcd69ed3398aafc7f985bc96d | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="hsbalance",
version="0.5.4",
author="Maged M.Eltorkoman",
author_email="newmaged@gmail.com",
description="Python tools for Practical Modeling and Solving High Speed Rotor... | 31.522727 | 101 | 0.62509 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="hsbalance",
version="0.5.4",
author="Maged M.Eltorkoman",
author_email="newmaged@gmail.com",
description="Python tools for Practical Modeling and Solving High Speed Rotor... | true | true |
f768b7068fe129cfc2c4869b39ab1b6134c50136 | 1,017 | py | Python | clockio/users/admin.py | elcolie/clockio | 713ed2f389895242cc9833d00efe50eae23621ad | [
"MIT"
] | null | null | null | clockio/users/admin.py | elcolie/clockio | 713ed2f389895242cc9833d00efe50eae23621ad | [
"MIT"
] | null | null | null | clockio/users/admin.py | elcolie/clockio | 713ed2f389895242cc9833d00efe50eae23621ad | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from clockio.users.forms import UserAdminChangeForm, UserAdminCreationForm
User = get_user_model()
@admin.register(User)
class Us... | 29.057143 | 74 | 0.564405 | from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from clockio.users.forms import UserAdminChangeForm, UserAdminCreationForm
User = get_user_model()
@admin.register(User)
class Us... | true | true |
f768b97bcca8b449f1d8c2da6efa3304c29e215d | 1,111 | py | Python | tuplex/python/tuplex/utils/__init__.py | rahulyesantharao/tuplex | 03733a57ccb5a3770eecaf1c3adcfb520ed82138 | [
"Apache-2.0"
] | 778 | 2021-06-30T03:40:43.000Z | 2022-03-28T20:40:20.000Z | tuplex/python/tuplex/utils/__init__.py | rahulyesantharao/tuplex | 03733a57ccb5a3770eecaf1c3adcfb520ed82138 | [
"Apache-2.0"
] | 41 | 2021-07-05T17:55:56.000Z | 2022-03-31T15:27:19.000Z | tuplex/python/tuplex/utils/__init__.py | rahulyesantharao/tuplex | 03733a57ccb5a3770eecaf1c3adcfb520ed82138 | [
"Apache-2.0"
] | 39 | 2021-07-01T02:40:33.000Z | 2022-03-30T21:46:55.000Z | #!/usr/bin/env python3
#----------------------------------------------------------------------------------------------------------------------#
# #
# Tuplex: Blazing... | 111.1 | 120 | 0.112511 | true | true | |
f768ba2135d0558b5f4fb1fd9d0e38115a094e36 | 14,509 | py | Python | huaweicloud-sdk-projectman/huaweicloudsdkprojectman/v4/model/issue_request_v4.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-projectman/huaweicloudsdkprojectman/v4/model/issue_request_v4.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-projectman/huaweicloudsdkprojectman/v4/model/issue_request_v4.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
class IssueRequestV4:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is ... | 26.720074 | 330 | 0.593218 |
import pprint
import re
import six
class IssueRequestV4:
sensitive_list = []
openapi_types = {
'actual_work_hours': 'float',
'assigned_id': 'int',
'begin_time': 'str',
'description': 'str',
'developer_id': 'int',
'domain_id': 'int',
'done_ratio'... | true | true |
f768babc32c0191645dba99dffca3b26638eeb09 | 17,165 | py | Python | src/conversation_analytics_toolkit/keyword_analysis.py | watson-developer-cloud/assistant-dialog-flow-analysis | 0c7bcd9527636dce77c74b80f60dbe23e6682e13 | [
"Apache-2.0"
] | 19 | 2020-06-07T19:13:06.000Z | 2022-01-22T02:34:11.000Z | src/conversation_analytics_toolkit/keyword_analysis.py | watson-developer-cloud/assistant-dialog-flow-analysis | 0c7bcd9527636dce77c74b80f60dbe23e6682e13 | [
"Apache-2.0"
] | 32 | 2020-06-04T14:09:03.000Z | 2021-02-11T15:05:07.000Z | src/conversation_analytics_toolkit/keyword_analysis.py | watson-developer-cloud/assistant-dialog-flow-analysis | 0c7bcd9527636dce77c74b80f60dbe23e6682e13 | [
"Apache-2.0"
] | 10 | 2020-06-04T18:49:53.000Z | 2021-11-26T12:42:08.000Z | # (C) Copyright IBM Corp. 2019, 2020.
#
# 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... | 41.262019 | 135 | 0.591902 |
from nltk.corpus import stopwords
import re
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
def order_ngram(ngram):
words = ngram.split()
words.sort()
return " ".join(words)
def clean_text(text, custom_stop_words = []):
REPLACE_BY_SPACE_RE = re.compil... | true | true |
f768bc434d007d95a541093ae3f116cf2b50527e | 84,164 | py | Python | cooltools/expected.py | open2c/cooltools | 704f259c4df5bc1c61be915bf56c80b00a0298ed | [
"MIT"
] | 36 | 2020-09-25T01:00:31.000Z | 2022-03-20T13:03:42.000Z | cooltools/expected.py | open2c/cooltools | 704f259c4df5bc1c61be915bf56c80b00a0298ed | [
"MIT"
] | 173 | 2020-09-29T19:28:31.000Z | 2022-03-31T20:41:18.000Z | cooltools/expected.py | open2c/cooltools | 704f259c4df5bc1c61be915bf56c80b00a0298ed | [
"MIT"
] | 12 | 2020-10-23T16:34:06.000Z | 2022-03-31T18:02:52.000Z | from itertools import chain, combinations
from collections import defaultdict
from functools import partial
import warnings
import multiprocess as mp
import numpy as np
import pandas as pd
from scipy.signal import fftconvolve
from scipy.interpolate import interp1d
from cooler.tools import partition
import cooler
im... | 37.174912 | 145 | 0.628856 | from itertools import chain, combinations
from collections import defaultdict
from functools import partial
import warnings
import multiprocess as mp
import numpy as np
import pandas as pd
from scipy.signal import fftconvolve
from scipy.interpolate import interp1d
from cooler.tools import partition
import cooler
im... | true | true |
f768bc70f4dbb74ee567a9114dd6f5d617d2ca83 | 1,123 | py | Python | examples/pwm.py | dgatwood/ioe-c | e8909b67ce81274ff8f55888085675a251636cd8 | [
"MIT"
] | 2 | 2021-04-09T09:04:51.000Z | 2022-02-08T01:46:54.000Z | examples/pwm.py | dgatwood/ioe-c | e8909b67ce81274ff8f55888085675a251636cd8 | [
"MIT"
] | 10 | 2020-08-29T20:26:32.000Z | 2022-03-09T15:17:31.000Z | examples/pwm.py | dgatwood/ioe-c | e8909b67ce81274ff8f55888085675a251636cd8 | [
"MIT"
] | 11 | 2020-09-28T17:53:14.000Z | 2022-03-05T18:24:40.000Z | #!/usr/bin/env python3
import time
import colorsys
import ioexpander as io
print("""pwm.py
Demonstrates running a common-cathode RGB LED, or trio of LEDs wired between each PWM pin and Ground.
You must wire your Red, Green and Blue LEDs or LED elements to pins 1, 3 and 5.
Press Ctrl+C to exit.
""")
PIN_RED = 1
P... | 24.955556 | 104 | 0.69902 | import time
import colorsys
import ioexpander as io
print("""pwm.py
Demonstrates running a common-cathode RGB LED, or trio of LEDs wired between each PWM pin and Ground.
You must wire your Red, Green and Blue LEDs or LED elements to pins 1, 3 and 5.
Press Ctrl+C to exit.
""")
PIN_RED = 1
PIN_GREEN = 3
PIN_BLUE =... | true | true |
f768bcd3382d62348b0c68820ab393a79961eb5e | 292 | py | Python | poetry_polylith_plugin/components/projects/__init__.py | DavidVujic/poetry-polylith-plugin | dfa7e8542e99812c2fa02dc46672c1f27e49cad2 | [
"MIT"
] | 5 | 2022-02-13T15:25:40.000Z | 2022-03-23T14:59:46.000Z | poetry_polylith_plugin/components/projects/__init__.py | DavidVujic/poetry-polylith-plugin | dfa7e8542e99812c2fa02dc46672c1f27e49cad2 | [
"MIT"
] | null | null | null | poetry_polylith_plugin/components/projects/__init__.py | DavidVujic/poetry-polylith-plugin | dfa7e8542e99812c2fa02dc46672c1f27e49cad2 | [
"MIT"
] | null | null | null | from poetry_polylith_plugin.components.projects.constants import dir_name
from poetry_polylith_plugin.components.projects.create import create_project
from poetry_polylith_plugin.components.projects.get import get_project_names
__all__ = ["create_project", "get_project_names", "dir_name"]
| 41.714286 | 76 | 0.866438 | from poetry_polylith_plugin.components.projects.constants import dir_name
from poetry_polylith_plugin.components.projects.create import create_project
from poetry_polylith_plugin.components.projects.get import get_project_names
__all__ = ["create_project", "get_project_names", "dir_name"]
| true | true |
f768bda3c57540ffbf0bda423fa21d7d7ec5249f | 3,975 | py | Python | delivery_api_client/Model/unexpected_error.py | adobe/target-python-sdk | f3e9b1bb6c8e1984e3d758ab1fe1a71225ade13e | [
"Apache-2.0"
] | 3 | 2021-05-25T20:10:46.000Z | 2021-06-15T05:49:18.000Z | delivery_api_client/Model/unexpected_error.py | adobe/target-python-sdk | f3e9b1bb6c8e1984e3d758ab1fe1a71225ade13e | [
"Apache-2.0"
] | 15 | 2021-01-13T22:53:25.000Z | 2021-09-03T23:11:25.000Z | delivery_api_client/Model/unexpected_error.py | adobe/target-python-sdk | f3e9b1bb6c8e1984e3d758ab1fe1a71225ade13e | [
"Apache-2.0"
] | 4 | 2021-01-04T18:44:01.000Z | 2022-03-15T21:30:11.000Z | # coding: utf-8
"""
Adobe Target Delivery API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
i... | 27.413793 | 129 | 0.571321 |
import pprint
import re
import six
class UnexpectedError(object):
openapi_types = {
'status': 'int',
'message': 'str'
}
attribute_map = {
'status': 'status',
'message': 'message'
}
def __init__(self, status=None, message=None):
self._status = None
... | true | true |
f768be0ba02e2caa14d1eff544ce4a349872d224 | 72,751 | py | Python | mne/forward/forward.py | vferat/mne-python | 54e07b3257ee44ae28c5253f47ef73909ef23bfd | [
"BSD-3-Clause"
] | null | null | null | mne/forward/forward.py | vferat/mne-python | 54e07b3257ee44ae28c5253f47ef73909ef23bfd | [
"BSD-3-Clause"
] | null | null | null | mne/forward/forward.py | vferat/mne-python | 54e07b3257ee44ae28c5253f47ef73909ef23bfd | [
"BSD-3-Clause"
] | 1 | 2021-12-13T14:29:28.000Z | 2021-12-13T14:29:28.000Z | # Authors: Matti Hämäläinen <msh@nmr.mgh.harvard.edu>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
# The computations in this code were primarily derived from Matti Hämäläinen's
# C code.
from time import time
from copy ... | 38.049686 | 79 | 0.5936 |
# C code.
from time import time
from copy import deepcopy
import re
import numpy as np
from scipy import linalg, sparse
import shutil
import os
from os import path as op
import tempfile
from ..io import RawArray, Info
from ..io.constants import FIFF
from ..io.open import fiff_open
from ..io.tree import dir_tree_fi... | true | true |
f768c25b0e97a811f5de50c017a0f992c496108d | 202 | py | Python | Leetcode/1317. Convert Integer to the Sum of Two No-Zero Integers/solution1.py | asanoviskhak/Outtalent | c500e8ad498f76d57eb87a9776a04af7bdda913d | [
"MIT"
] | 51 | 2020-07-12T21:27:47.000Z | 2022-02-11T19:25:36.000Z | Leetcode/1317. Convert Integer to the Sum of Two No-Zero Integers/solution1.py | CrazySquirrel/Outtalent | 8a10b23335d8e9f080e5c39715b38bcc2916ff00 | [
"MIT"
] | null | null | null | Leetcode/1317. Convert Integer to the Sum of Two No-Zero Integers/solution1.py | CrazySquirrel/Outtalent | 8a10b23335d8e9f080e5c39715b38bcc2916ff00 | [
"MIT"
] | 32 | 2020-07-27T13:54:24.000Z | 2021-12-25T18:12:50.000Z | class Solution:
def getNoZeroIntegers(self, n: int) -> List[int]:
for i in range(0, n + 1):
if str(i).count('0') == str(n - i).count('0') == 0:
return [i, n - i]
| 33.666667 | 63 | 0.470297 | class Solution:
def getNoZeroIntegers(self, n: int) -> List[int]:
for i in range(0, n + 1):
if str(i).count('0') == str(n - i).count('0') == 0:
return [i, n - i]
| true | true |
f768c2a6295294c869ebbba8972b3414fc07301f | 2,775 | py | Python | glue/_plugin_helpers.py | sergiopasra/glue | c25a217a122a11818382672c99cb21f57a30636f | [
"BSD-3-Clause"
] | null | null | null | glue/_plugin_helpers.py | sergiopasra/glue | c25a217a122a11818382672c99cb21f57a30636f | [
"BSD-3-Clause"
] | null | null | null | glue/_plugin_helpers.py | sergiopasra/glue | c25a217a122a11818382672c99cb21f57a30636f | [
"BSD-3-Clause"
] | null | null | null | # The following funtion is a thin wrapper around iter_entry_points. The reason it
# is in this separate file is that when making the Mac app, py2app doesn't
# support entry points, so we replace this function with a version that has the
# entry points we want hardcoded. If this function was in glue/main.py, the
# refer... | 30.833333 | 81 | 0.654414 | # support entry points, so we replace this function with a version that has the
# entry points we want hardcoded. If this function was in glue/main.py, the
# reference to the iter_plugin_entry_points function in load_plugin would be
# evaluated at compile time rather than at runtime, so the patched version
# wouldn't b... | true | true |
f768c2bcb8236d458197da51916c9b29a8926bc7 | 11,295 | py | Python | e2e_tests/tests/command/test_run.py | jojochuang/determined | 22a7cd4b497767d7420b26ead769ba7e61d7f90a | [
"Apache-2.0"
] | 1 | 2020-09-23T12:02:32.000Z | 2020-09-23T12:02:32.000Z | e2e_tests/tests/command/test_run.py | jojochuang/determined | 22a7cd4b497767d7420b26ead769ba7e61d7f90a | [
"Apache-2.0"
] | null | null | null | e2e_tests/tests/command/test_run.py | jojochuang/determined | 22a7cd4b497767d7420b26ead769ba7e61d7f90a | [
"Apache-2.0"
] | null | null | null | import re
import subprocess
import tempfile
import time
from pathlib import Path
from typing import Any, List
import docker
import docker.errors
import pytest
import yaml
from tests import command as cmd
from tests import config as conf
from tests.filetree import FileTree
@pytest.mark.slow # type: ignore
@pytest.m... | 27.888889 | 100 | 0.502435 | import re
import subprocess
import tempfile
import time
from pathlib import Path
from typing import Any, List
import docker
import docker.errors
import pytest
import yaml
from tests import command as cmd
from tests import config as conf
from tests.filetree import FileTree
@pytest.mark.slow @pytest.mark.e2e_cpu de... | true | true |
f768c3663062908e8af5181609c2b6fa7e96850f | 743 | py | Python | tsp_heuristic.py | CSI-Woo-Lab/PandaSchedulingModel | 0ae4a20283ec7f2ffa1d0e0ebecdb1f4d2156d8a | [
"MIT"
] | 3 | 2020-12-04T04:54:41.000Z | 2021-11-12T11:23:20.000Z | tsp_heuristic.py | CSI-Woo-Lab/PandaSchedulingModel | 0ae4a20283ec7f2ffa1d0e0ebecdb1f4d2156d8a | [
"MIT"
] | null | null | null | tsp_heuristic.py | CSI-Woo-Lab/PandaSchedulingModel | 0ae4a20283ec7f2ffa1d0e0ebecdb1f4d2156d8a | [
"MIT"
] | 2 | 2021-02-26T01:09:13.000Z | 2021-11-22T07:44:46.000Z | import numpy as np
import torch
CONST = 100000.0
def calc_dist(p, q):
return np.sqrt(((p[1] - q[1])**2)+((p[0] - q[0]) **2)) * CONST
def get_ref_reward(pointset):
if isinstance(pointset, torch.cuda.FloatTensor) or isinstance(pointset, torch.FloatTensor):
pointset = pointset.detach().numpy()
num... | 32.304348 | 96 | 0.636608 | import numpy as np
import torch
CONST = 100000.0
def calc_dist(p, q):
return np.sqrt(((p[1] - q[1])**2)+((p[0] - q[0]) **2)) * CONST
def get_ref_reward(pointset):
if isinstance(pointset, torch.cuda.FloatTensor) or isinstance(pointset, torch.FloatTensor):
pointset = pointset.detach().numpy()
num... | true | true |
f768c38875df396b13543c586e16ba858f3b30dd | 8,343 | py | Python | atm/atm.py | edwardclifford/atm-protocol | a2a44461c3d6d6335a8f9be9d6539e645182a859 | [
"Apache-2.0"
] | null | null | null | atm/atm.py | edwardclifford/atm-protocol | a2a44461c3d6d6335a8f9be9d6539e645182a859 | [
"Apache-2.0"
] | null | null | null | atm/atm.py | edwardclifford/atm-protocol | a2a44461c3d6d6335a8f9be9d6539e645182a859 | [
"Apache-2.0"
] | null | null | null | import logging
import sys
import cmd
from interface.card import NotProvisioned, AlreadyProvisioned
from interface import card, bank
import os
import json
import argparse
from Crypto.Cipher import AES
from Crypto import Random
import random
newTamp = ""
log = logging.getLogger('')
log.setLevel(logging.DEBUG)
log_format ... | 37.245536 | 157 | 0.588038 | import logging
import sys
import cmd
from interface.card import NotProvisioned, AlreadyProvisioned
from interface import card, bank
import os
import json
import argparse
from Crypto.Cipher import AES
from Crypto import Random
import random
newTamp = ""
log = logging.getLogger('')
log.setLevel(logging.DEBUG)
log_format ... | false | true |
f768c3a5af1deddb3aaa3a384134422bcfff2d9b | 30,225 | py | Python | lib/silfont/feax_parser.py | DalavanCloud/pysilfont | 72323c14fc28f9450bfe0caac2ca11e722c1a88e | [
"MIT"
] | 1 | 2019-01-19T04:19:21.000Z | 2019-01-19T04:19:21.000Z | lib/silfont/feax_parser.py | DalavanCloud/pysilfont | 72323c14fc28f9450bfe0caac2ca11e722c1a88e | [
"MIT"
] | null | null | null | lib/silfont/feax_parser.py | DalavanCloud/pysilfont | 72323c14fc28f9450bfe0caac2ca11e722c1a88e | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from fontTools.feaLib import ast
from fontTools.feaLib.parser import Parser
from fontTools.feaLib.lexer import IncludingLexer, Lexer
import silfont.feax_lexer as feax_lexer
from fontTools.feaLib.error import FeatureLibError
import silfont.feax_ast as astx
import io, re, math
impo... | 45.044709 | 145 | 0.581902 | from __future__ import unicode_literals
from fontTools.feaLib import ast
from fontTools.feaLib.parser import Parser
from fontTools.feaLib.lexer import IncludingLexer, Lexer
import silfont.feax_lexer as feax_lexer
from fontTools.feaLib.error import FeatureLibError
import silfont.feax_ast as astx
import io, re, math
impo... | true | true |
f768c4c05e2a96abde1c8884000dc51370b778d7 | 2,190 | py | Python | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/subnet_override.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | 1 | 2018-11-09T06:16:34.000Z | 2018-11-09T06:16:34.000Z | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/subnet_override.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | null | null | null | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/subnet_override.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | 1 | 2018-11-09T06:17:41.000Z | 2018-11-09T06:17:41.000Z | # 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 ... | 47.608696 | 138 | 0.691781 |
from msrest.serialization import Model
class SubnetOverride(Model):
_attribute_map = {
'resource_id': {'key': 'resourceId', 'type': 'str'},
'lab_subnet_name': {'key': 'labSubnetName', 'type': 'str'},
'use_in_vm_creation_permission': {'key': 'useInVmCreationPermission', 'type': 'str'},
... | true | true |
f768c59f7a9c49ab479c7b39d2d1a79b989733dd | 636 | py | Python | src/queues.py | yutiansut/PyBitmessage | a29f7534ee54a6b93498ec13e581ee2da22dfc94 | [
"MIT"
] | null | null | null | src/queues.py | yutiansut/PyBitmessage | a29f7534ee54a6b93498ec13e581ee2da22dfc94 | [
"MIT"
] | null | null | null | src/queues.py | yutiansut/PyBitmessage | a29f7534ee54a6b93498ec13e581ee2da22dfc94 | [
"MIT"
] | null | null | null | import Queue
from class_objectProcessorQueue import ObjectProcessorQueue
from multiqueue import MultiQueue
workerQueue = Queue.Queue()
UISignalQueue = Queue.Queue()
addressGeneratorQueue = Queue.Queue()
# receiveDataThreads dump objects they hear on the network into this queue to be processed.
objectProcessorQueue = ... | 35.333333 | 96 | 0.811321 | import Queue
from class_objectProcessorQueue import ObjectProcessorQueue
from multiqueue import MultiQueue
workerQueue = Queue.Queue()
UISignalQueue = Queue.Queue()
addressGeneratorQueue = Queue.Queue()
objectProcessorQueue = ObjectProcessorQueue()
invQueue = MultiQueue()
addrQueue = MultiQueue()
portCheckerQueue = Q... | true | true |
f768c6626f1b4e78048b5ccb04fce507cf0d41ba | 232 | py | Python | python/file/write_message.py | letitgone/python-crash-course | 2551f2977f2814393fc4f44b8e2f20bdcc20141b | [
"MIT"
] | null | null | null | python/file/write_message.py | letitgone/python-crash-course | 2551f2977f2814393fc4f44b8e2f20bdcc20141b | [
"MIT"
] | null | null | null | python/file/write_message.py | letitgone/python-crash-course | 2551f2977f2814393fc4f44b8e2f20bdcc20141b | [
"MIT"
] | null | null | null | # @Author ZhangGJ
# @Date 2020/12/30 18:14
filename = '../../resources/programming.txt'
with open(filename, 'w') as file_object:
file_object.write("I love programming.\n")
file_object.write("I love creating new games.\n")
| 25.777778 | 53 | 0.693966 |
filename = '../../resources/programming.txt'
with open(filename, 'w') as file_object:
file_object.write("I love programming.\n")
file_object.write("I love creating new games.\n")
| true | true |
f768c6704ff0b1cc7550659e9fecc8afd4f17fc6 | 3,098 | py | Python | rest_framework_xml/parsers.py | yeild-web/django-rest-framework-xml | 91faad4d2b5a6ae5020b261d6a767229370303bb | [
"BSD-3-Clause"
] | null | null | null | rest_framework_xml/parsers.py | yeild-web/django-rest-framework-xml | 91faad4d2b5a6ae5020b261d6a767229370303bb | [
"BSD-3-Clause"
] | null | null | null | rest_framework_xml/parsers.py | yeild-web/django-rest-framework-xml | 91faad4d2b5a6ae5020b261d6a767229370303bb | [
"BSD-3-Clause"
] | null | null | null | """
Provides XML parsing support.
"""
import datetime
import decimal
from django.conf import settings
from rest_framework.exceptions import ParseError
from rest_framework.parsers import BaseParser
from .compat import etree
import re
_parser = re.compile(r""" # A numeric string consists of:
# \s*
(?P<si... | 29.504762 | 81 | 0.547773 | import datetime
import decimal
from django.conf import settings
from rest_framework.exceptions import ParseError
from rest_framework.parsers import BaseParser
from .compat import etree
import re
_parser = re.compile(r""" # A numeric string consists of:
# \s*
(?P<sign>[-+])? # an optional s... | true | true |
f768c671923cbd81ce045ab7122f4799ee250e89 | 8,982 | py | Python | benchmarks/C/calcite_ChemApp/eq.py | GeoStat-Framework/ogs5py_benchmarks | 0b6db19b87cfad36459757f99ce2458f8e12b20b | [
"BSD-4-Clause"
] | 3 | 2019-01-15T17:38:11.000Z | 2020-01-07T23:44:12.000Z | benchmarks/C/calcite_ChemApp/eq.py | GeoStat-Framework/ogs5py_benchmarks | 0b6db19b87cfad36459757f99ce2458f8e12b20b | [
"BSD-4-Clause"
] | 1 | 2020-05-12T09:18:09.000Z | 2020-05-12T10:48:32.000Z | benchmarks/C/calcite_ChemApp/eq.py | GeoStat-Framework/ogs5py_benchmarks | 0b6db19b87cfad36459757f99ce2458f8e12b20b | [
"BSD-4-Clause"
] | 1 | 2020-01-08T13:28:50.000Z | 2020-01-08T13:28:50.000Z | # -*- coding: utf-8 -*-
from ogs5py import OGS
model = OGS(
task_root='eq_root',
task_id='eq',
output_dir='out',
)
model.msh.read_file('eq.msh')
model.gli.read_file('eq.gli')
model.pcs.add_block(
main_key='PROCESS',
PCS_TYPE='GROUNDWATER_FLOW',
NUM_TYPE='NEW',
ELEMENT_MATRIX_OUTPUT=0,
)
mod... | 22.014706 | 49 | 0.620797 | from ogs5py import OGS
model = OGS(
task_root='eq_root',
task_id='eq',
output_dir='out',
)
model.msh.read_file('eq.msh')
model.gli.read_file('eq.gli')
model.pcs.add_block(
main_key='PROCESS',
PCS_TYPE='GROUNDWATER_FLOW',
NUM_TYPE='NEW',
ELEMENT_MATRIX_OUTPUT=0,
)
model.pcs.add_block(
ma... | true | true |
f768c7f8c1c9d1a845bd9091ebe3a4fe82c32563 | 7,355 | py | Python | pybamm/models/full_battery_models/lithium_ion/basic_spm.py | dion-w/PyBaMM | aeb9bcc82bb5dc3fba4fa045c4cad9d2d41b6359 | [
"BSD-3-Clause"
] | 1 | 2022-03-24T01:23:16.000Z | 2022-03-24T01:23:16.000Z | pybamm/models/full_battery_models/lithium_ion/basic_spm.py | sxwangxiang/PyBaMM | 23157aebce218444edc83b525dfb2c7fc8637598 | [
"BSD-3-Clause"
] | null | null | null | pybamm/models/full_battery_models/lithium_ion/basic_spm.py | sxwangxiang/PyBaMM | 23157aebce218444edc83b525dfb2c7fc8637598 | [
"BSD-3-Clause"
] | null | null | null | #
# Basic Single Particle Model (SPM)
#
import pybamm
from .base_lithium_ion_model import BaseModel
class BasicSPM(BaseModel):
"""Single Particle Model (SPM) model of a lithium-ion battery, from [2]_.
This class differs from the :class:`pybamm.lithium_ion.SPM` model class in that it
shows the whole model... | 39.756757 | 86 | 0.569816 | import pybamm
from .base_lithium_ion_model import BaseModel
class BasicSPM(BaseModel):
def __init__(self, name="Single Particle Model"):
super().__init__({}, name)
pybamm.citations.register("Marquis2019")
param = self.param
... | true | true |
f768c80466261143d6acaebdf62af1e33dba90b2 | 1,393 | py | Python | code/Base_MNIST.py | Knowledge-Precipitation-Tribe/Recurrent-neural-network | 44faf239784d6318c986ae39a0a1982786e951fe | [
"MIT"
] | 2 | 2021-03-28T01:35:49.000Z | 2021-11-26T01:46:18.000Z | code/Base_MNIST.py | Knowledge-Precipitation-Tribe/Recurrent-neural-network | 44faf239784d6318c986ae39a0a1982786e951fe | [
"MIT"
] | null | null | null | code/Base_MNIST.py | Knowledge-Precipitation-Tribe/Recurrent-neural-network | 44faf239784d6318c986ae39a0a1982786e951fe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-#
'''
# Name: Base_MNIST
# Description:
# Author: super
# Date: 2020/6/19
'''
from matplotlib import pyplot as plt
import numpy as np
from Base import *
from ExtendedDataReader.MnistImageDataReader import *
def load_data():
dataReader = MnistImageDataReader(mode="tim... | 29.638298 | 139 | 0.697775 |
from matplotlib import pyplot as plt
import numpy as np
from Base import *
from ExtendedDataReader.MnistImageDataReader import *
def load_data():
dataReader = MnistImageDataReader(mode="timestep")
dataReader.ReadData()
dataReader.NormalizeX()
dataReader.NormalizeY(NetType.MultipleClassifier, base=... | true | true |
f768c8b1dfc5c7b1925623aa57a88fc1035e0f4c | 3,829 | py | Python | scripts_ignore/Traditional/ThinPlateSplines/ThinPlateSpline.py | adityavaishampayan/FaceSwap | 5b875b2bcf6212cd8404633e296a44886710d150 | [
"MIT"
] | 3 | 2020-08-01T05:23:19.000Z | 2022-03-29T19:21:39.000Z | scripts_ignore/Traditional/ThinPlateSplines/ThinPlateSpline.py | adityavaishampayan/FaceSwap | 5b875b2bcf6212cd8404633e296a44886710d150 | [
"MIT"
] | null | null | null | scripts_ignore/Traditional/ThinPlateSplines/ThinPlateSpline.py | adityavaishampayan/FaceSwap | 5b875b2bcf6212cd8404633e296a44886710d150 | [
"MIT"
] | 1 | 2020-08-25T22:03:08.000Z | 2020-08-25T22:03:08.000Z | import numpy as np
import cv2
import sys
import math
import matplotlib.pyplot as plt
def fxy(pt1,pts2,weights):
K = np.zeros([pts2.shape[0],1])
for i in range(pts2.shape[0]):
K[i] = U(np.linalg.norm((pts2[i]-pt1),ord =2)+sys.float_info.epsilon)
f = weights[-1] + weights[-3]*pt1[0] +weights[-2]*pt1[... | 31.644628 | 120 | 0.611648 | import numpy as np
import cv2
import sys
import math
import matplotlib.pyplot as plt
def fxy(pt1,pts2,weights):
K = np.zeros([pts2.shape[0],1])
for i in range(pts2.shape[0]):
K[i] = U(np.linalg.norm((pts2[i]-pt1),ord =2)+sys.float_info.epsilon)
f = weights[-1] + weights[-3]*pt1[0] +weights[-2]*pt1[... | true | true |
f768caab50aaf6edd34ab849d8bdf16aff703e36 | 9,554 | py | Python | consoleme/lib/account_indexers/aws_organizations.py | shyovn/consoleme | 471592b718b22f83244609ab47d5bf3f9a715a4d | [
"Apache-2.0"
] | 2,835 | 2020-12-09T19:07:24.000Z | 2022-03-31T06:38:44.000Z | consoleme/lib/account_indexers/aws_organizations.py | shyovn/consoleme | 471592b718b22f83244609ab47d5bf3f9a715a4d | [
"Apache-2.0"
] | 179 | 2020-12-10T01:51:25.000Z | 2022-03-31T02:06:06.000Z | consoleme/lib/account_indexers/aws_organizations.py | shyovn/consoleme | 471592b718b22f83244609ab47d5bf3f9a715a4d | [
"Apache-2.0"
] | 219 | 2020-12-09T21:30:56.000Z | 2022-03-31T05:57:36.000Z | from typing import Any, Dict, List, Literal
from asgiref.sync import sync_to_async
from botocore.exceptions import ClientError
from cloudaux import CloudAux
from cloudaux.aws.decorators import paginated
from cloudaux.aws.sts import boto3_cached_conn
from consoleme.config import config
from consoleme.exceptions.except... | 32.386441 | 111 | 0.662026 | from typing import Any, Dict, List, Literal
from asgiref.sync import sync_to_async
from botocore.exceptions import ClientError
from cloudaux import CloudAux
from cloudaux.aws.decorators import paginated
from cloudaux.aws.sts import boto3_cached_conn
from consoleme.config import config
from consoleme.exceptions.except... | true | true |
f768cbfe2caff7e23c68710476570285f7e12e03 | 280 | py | Python | hangman_project/hangman_game/views/main.py | aurum86/hangman-game-py-project | 90affa4a9ad9882907daa3c4e461859850e0bace | [
"MIT"
] | null | null | null | hangman_project/hangman_game/views/main.py | aurum86/hangman-game-py-project | 90affa4a9ad9882907daa3c4e461859850e0bace | [
"MIT"
] | 3 | 2021-03-30T13:56:23.000Z | 2021-06-10T19:32:47.000Z | hangman_project/hangman_game/views/main.py | aurum86/hangman-game-py-project | 90affa4a9ad9882907daa3c4e461859850e0bace | [
"MIT"
] | null | null | null | from django.shortcuts import redirect
from django.http import HttpResponseRedirect
from django.urls import reverse
def get_post_response(view_name: str):
return HttpResponseRedirect(reverse(viewname=view_name))
def redirect_view(request):
return redirect("/hangman/")
| 23.333333 | 60 | 0.807143 | from django.shortcuts import redirect
from django.http import HttpResponseRedirect
from django.urls import reverse
def get_post_response(view_name: str):
return HttpResponseRedirect(reverse(viewname=view_name))
def redirect_view(request):
return redirect("/hangman/")
| true | true |
f768cc864fe20d5784cae5387b5c7fe4db21ca1e | 634 | py | Python | backend/src/manage.py | unepwcmc/madingley-model-app | c93902a07487e5ec730d5cbbcac82fc19cdedbc6 | [
"MIT"
] | 1 | 2020-10-08T08:44:12.000Z | 2020-10-08T08:44:12.000Z | backend/src/manage.py | unepwcmc/madingley-model-app | c93902a07487e5ec730d5cbbcac82fc19cdedbc6 | [
"MIT"
] | null | null | null | backend/src/manage.py | unepwcmc/madingley-model-app | c93902a07487e5ec730d5cbbcac82fc19cdedbc6 | [
"MIT"
] | 1 | 2020-04-23T08:53:58.000Z | 2020-04-23T08:53:58.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ecosystem_game.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise... | 28.818182 | 78 | 0.68612 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ecosystem_game.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "... | true | true |
f768cd13f9e8fc0d105258ca34cc9d18565c0761 | 1,203 | py | Python | custom_components/dwains_dashboard/load_dashboard.py | sischnei/dwains-lovelace-dashboard | c31426b992d41bdfd55eabdcfe934bc3e94842d1 | [
"MIT"
] | 665 | 2020-10-16T18:20:52.000Z | 2022-03-31T13:22:08.000Z | config/custom_components/dwains_dashboard/load_dashboard.py | givemhell/homeassistant-config | 8ca951d299cb4df19e5fcc37bfea38c9f04f5a2a | [
"MIT"
] | 206 | 2020-10-17T07:05:03.000Z | 2022-03-31T08:08:13.000Z | config/custom_components/dwains_dashboard/load_dashboard.py | givemhell/homeassistant-config | 8ca951d299cb4df19e5fcc37bfea38c9f04f5a2a | [
"MIT"
] | 120 | 2020-11-01T13:03:14.000Z | 2022-03-28T06:50:26.000Z | import logging
from homeassistant.components.lovelace.dashboard import LovelaceYAML
from homeassistant.components.lovelace import _register_panel
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
def load_dashboard(hass, config_entry):
#_LOGGER.warning(config_entry.options)
#_LOGG... | 33.416667 | 109 | 0.710723 | import logging
from homeassistant.components.lovelace.dashboard import LovelaceYAML
from homeassistant.components.lovelace import _register_panel
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
def load_dashboard(hass, config_entry):
sidepanel_title = "Dwains Dashboard"
... | true | true |
f768cfe29f6c3735d1f33e5c7dd7afcd8674ff1e | 4,321 | py | Python | caldera/utils/sparse.py | jvrana/caldera | a346324e77f20739e00a82f97530dda4906f59dd | [
"MIT"
] | 2 | 2021-12-13T17:52:17.000Z | 2021-12-13T17:52:18.000Z | caldera/utils/sparse.py | jvrana/caldera | a346324e77f20739e00a82f97530dda4906f59dd | [
"MIT"
] | 4 | 2020-10-06T21:06:15.000Z | 2020-10-10T01:18:23.000Z | caldera/utils/sparse.py | jvrana/caldera | a346324e77f20739e00a82f97530dda4906f59dd | [
"MIT"
] | null | null | null | from typing import Optional
from typing import Type
import torch
from scipy.sparse import coo_matrix
from .indexing import SizeType
from .indexing import unroll_index
def torch_coo_to_scipy_coo(m: torch.sparse.FloatTensor) -> coo_matrix:
"""Convert torch :class:`torch.sparse.FloatTensor` tensor to.
:class:... | 28.24183 | 90 | 0.560287 | from typing import Optional
from typing import Type
import torch
from scipy.sparse import coo_matrix
from .indexing import SizeType
from .indexing import unroll_index
def torch_coo_to_scipy_coo(m: torch.sparse.FloatTensor) -> coo_matrix:
data = m.values().numpy()
indices = m.indices()
return coo_matrix(... | true | true |
f768cfe58cf398a38b77a9c3873bfae7b53bbbe2 | 12,956 | py | Python | mindspore/ops/_op_impl/tbe/__init__.py | wudenggang/mindspore | 95e75c3119909cc5c7c3098232851d1d7bc4ef8c | [
"Apache-2.0"
] | null | null | null | mindspore/ops/_op_impl/tbe/__init__.py | wudenggang/mindspore | 95e75c3119909cc5c7c3098232851d1d7bc4ef8c | [
"Apache-2.0"
] | null | null | null | mindspore/ops/_op_impl/tbe/__init__.py | wudenggang/mindspore | 95e75c3119909cc5c7c3098232851d1d7bc4ef8c | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 44.675862 | 95 | 0.877354 |
from .abs import _abs_tbe
from .inplace_add import _inplace_add_tbe
from .inplace_sub import _inplace_sub_tbe
from .abs_grad import _abs_grad_tbe
from .acos import _acos_tbe
from .acos_grad import _acos_grad_tbe
from .acosh import _acosh_tbe
from .acosh_grad import _acosh_grad_tbe
from .adam_apply_one_with_decay impor... | true | true |
f768d122bbb066e22873ceed23eed310fb9e98e0 | 905 | py | Python | python/src/setup.py | wisang1999/chirpstack-api | 905b310a883b2a27a5c6460d547c6eb7d92524e7 | [
"MIT"
] | null | null | null | python/src/setup.py | wisang1999/chirpstack-api | 905b310a883b2a27a5c6460d547c6eb7d92524e7 | [
"MIT"
] | null | null | null | python/src/setup.py | wisang1999/chirpstack-api | 905b310a883b2a27a5c6460d547c6eb7d92524e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import find_packages, setup
REQUIREMENTS = [
'grpcio',
'google-api-core'
]
CLASSIFIERS = [
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.7',
'Topic :: Communications',
'To... | 25.857143 | 56 | 0.645304 | from setuptools import find_packages, setup
REQUIREMENTS = [
'grpcio',
'google-api-core'
]
CLASSIFIERS = [
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.7',
'Topic :: Communications',
'Topic :: Software Developme... | true | true |
f768d1533f94c907ea0f974c6e4cccc4c320d81f | 4,871 | py | Python | database/models/account/User.py | ai404/esafe-platform | 2e29ab2d3deb81fd999b74a2f6844c54a836c6d8 | [
"MIT"
] | null | null | null | database/models/account/User.py | ai404/esafe-platform | 2e29ab2d3deb81fd999b74a2f6844c54a836c6d8 | [
"MIT"
] | null | null | null | database/models/account/User.py | ai404/esafe-platform | 2e29ab2d3deb81fd999b74a2f6844c54a836c6d8 | [
"MIT"
] | null | null | null | import datetime
from sqlalchemy import Column, Integer, String, DateTime, Boolean, ForeignKey, Text
from sqlalchemy.orm import relationship
from sqlalchemy.sql import expression, func, text
from werkzeug.security import check_password_hash, generate_password_hash
from sqlalchemy.sql import and_
from flask i... | 33.593103 | 105 | 0.625949 | import datetime
from sqlalchemy import Column, Integer, String, DateTime, Boolean, ForeignKey, Text
from sqlalchemy.orm import relationship
from sqlalchemy.sql import expression, func, text
from werkzeug.security import check_password_hash, generate_password_hash
from sqlalchemy.sql import and_
from flask i... | true | true |
f768d2e6ab5ec5f46cbdc9f190b6268650cae93b | 7,130 | py | Python | utils.py | anksng/PDF-TIFF-image-extractor-with-anonymization-of-faces-and-license-plates | 0854aa09b51ade3673bb512a76718b43d77b063c | [
"MIT"
] | null | null | null | utils.py | anksng/PDF-TIFF-image-extractor-with-anonymization-of-faces-and-license-plates | 0854aa09b51ade3673bb512a76718b43d77b063c | [
"MIT"
] | 11 | 2020-03-24T18:10:01.000Z | 2022-03-12T00:15:48.000Z | utils.py | anksng/PDF-TIFF-image-extractor-with-anonymization-of-faces-and-license-plates | 0854aa09b51ade3673bb512a76718b43d77b063c | [
"MIT"
] | null | null | null | import glob
import os
import fitz
import PIL as P
import io
import numpy as np
import turicreate as tc
import pandas as pd
def load_paths(path):
"""
Loads pdf and tiff files from the root folder as a 1-D list.
-----------------------------------------------------------
:param
path: str, path of ... | 34.114833 | 116 | 0.503506 | import glob
import os
import fitz
import PIL as P
import io
import numpy as np
import turicreate as tc
import pandas as pd
def load_paths(path):
paths = glob.glob(path + '/**', recursive=True)
pdfs = [i for i in paths if ('.pdf') in i]
pdfs_ = [i for i in paths if ('.PDF') in i]
tiff = [i for i in paths... | true | true |
f768d45de3a20430822215fcaace343505ca1b7e | 1,142 | py | Python | app/core/tests/test_admin.py | pshrimal000/recipe-app-api | 0e08b1b0e9d8c3a99e0a06bce11a6e3666f6b28d | [
"MIT"
] | 1 | 2021-05-08T16:37:18.000Z | 2021-05-08T16:37:18.000Z | app/core/tests/test_admin.py | pshrimal000/recipe-app-api | 0e08b1b0e9d8c3a99e0a06bce11a6e3666f6b28d | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | pshrimal000/recipe-app-api | 0e08b1b0e9d8c3a99e0a06bce11a6e3666f6b28d | [
"MIT"
] | 1 | 2021-10-31T11:57:15.000Z | 2021-10-31T11:57:15.000Z | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import Client
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='ad... | 31.722222 | 68 | 0.649737 | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import Client
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='ad... | true | true |
f768d46f66b6b97f24f78dfd1b6bc540af553b94 | 162 | py | Python | Shivani/leap year.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/leap year.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/leap year.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | n=int(input("enter year\n"))
if(n%400==0 and n%100==0):
print("leap year")
elif(n%4==0 and n%100!=0):
print("leap year")
else:
print("not leap year")
| 20.25 | 28 | 0.58642 | n=int(input("enter year\n"))
if(n%400==0 and n%100==0):
print("leap year")
elif(n%4==0 and n%100!=0):
print("leap year")
else:
print("not leap year")
| true | true |
f768d67622f62f60eeb5acb02ae47c4211ca6e21 | 4,575 | py | Python | videodownloader/providers/__init__.py | JakeWharton/py-videodownloader | 787e88ad46280288f559e728598fcb2a8487129c | [
"Apache-2.0"
] | 41 | 2015-02-02T02:05:40.000Z | 2021-08-11T04:36:21.000Z | videodownloader/providers/__init__.py | clsung/py-videodownloader | 0e560d768b8445c39610e18667f5f4954ecbb253 | [
"Apache-2.0"
] | 2 | 2016-08-20T16:50:55.000Z | 2017-07-06T15:36:16.000Z | videodownloader/providers/__init__.py | clsung/py-videodownloader | 0e560d768b8445c39610e18667f5f4954ecbb253 | [
"Apache-2.0"
] | 15 | 2015-03-12T08:55:33.000Z | 2020-06-04T22:51:42.000Z | __license__ = '''
Copyright 2010 Jake Wharton
py-video-downloader is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
py-video-downloade... | 31.770833 | 104 | 0.603279 | __license__ = '''
Copyright 2010 Jake Wharton
py-video-downloader is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
py-video-downloade... | false | true |
f768d7f1ce7a515afabfacf428a6a52bfb1b2ca1 | 2,940 | py | Python | tests/test_reflection.py | CraftSpider/SpiderTools | 4bf155feec7cb983e8d283d93552902ec85178a2 | [
"MIT"
] | 5 | 2019-10-14T13:50:02.000Z | 2021-09-23T18:48:27.000Z | tests/test_reflection.py | CraftSpider/SpiderTools | 4bf155feec7cb983e8d283d93552902ec85178a2 | [
"MIT"
] | null | null | null | tests/test_reflection.py | CraftSpider/SpiderTools | 4bf155feec7cb983e8d283d93552902ec85178a2 | [
"MIT"
] | null | null | null |
import inspect
import pytest
import spidertools.common.reflection as reflection
@pytest.mark.parametrize("package", ["command_lang", "common", "discord", "math", "twitch", "webserver"])
def test_docs(package):
result = reflection.get_undoced(f"spidertools.{package}")
assert len(result) is 0, f"Missing docume... | 35.853659 | 114 | 0.667687 |
import inspect
import pytest
import spidertools.common.reflection as reflection
@pytest.mark.parametrize("package", ["command_lang", "common", "discord", "math", "twitch", "webserver"])
def test_docs(package):
result = reflection.get_undoced(f"spidertools.{package}")
assert len(result) is 0, f"Missing docume... | true | true |
f768d83da9a1e930ad4978dbb4756b8b6270b2c2 | 780 | py | Python | mk2/plugins/save.py | mcdevs/mark2 | b9977fe280cb5d38998787a53914ff1f2fefc693 | [
"MIT-feh"
] | 28 | 2015-03-07T07:44:56.000Z | 2020-08-11T23:31:37.000Z | mk2/plugins/save.py | frostyfrog/mark2 | aacb90bef6c752278cf0a4ab7e551424eadb9a56 | [
"MIT-feh"
] | 14 | 2015-01-16T22:53:18.000Z | 2018-10-08T18:04:57.000Z | mk2/plugins/save.py | frostyfrog/mark2 | aacb90bef6c752278cf0a4ab7e551424eadb9a56 | [
"MIT-feh"
] | 14 | 2015-02-09T15:05:35.000Z | 2020-12-01T09:35:08.000Z | from mk2.plugins import Plugin
from mk2.events import Hook
class Save(Plugin):
warn_message = Plugin.Property(default="WARNING: saving map in {delay}.")
message = Plugin.Property(default="MAP IS SAVING.")
def setup(self):
self.register(self.save, Hook, public=True, name='save', doc='save... | 28.888889 | 84 | 0.612821 | from mk2.plugins import Plugin
from mk2.events import Hook
class Save(Plugin):
warn_message = Plugin.Property(default="WARNING: saving map in {delay}.")
message = Plugin.Property(default="MAP IS SAVING.")
def setup(self):
self.register(self.save, Hook, public=True, name='save', doc='save... | true | true |
f768d8d07ab3228d9acc64842922bad2db82d026 | 18,071 | py | Python | aiida/tools/graph/age_rules.py | frssp/aiida-core | e0fb53bb94af72c063397e0c7c796b2f7f191db6 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | aiida/tools/graph/age_rules.py | frssp/aiida-core | e0fb53bb94af72c063397e0c7c796b2f7f191db6 | [
"MIT",
"BSD-3-Clause"
] | 6 | 2019-12-17T16:01:25.000Z | 2020-12-11T10:37:12.000Z | aiida/tools/graph/age_rules.py | frssp/aiida-core | e0fb53bb94af72c063397e0c7c796b2f7f191db6 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 42.320843 | 109 | 0.63826 |
from abc import ABCMeta, abstractmethod
from collections import defaultdict
import numpy as np
from aiida import orm
from aiida.common.lang import type_check
from aiida.tools.graph.age_entities import Basket
class Operation(metaclass=ABCMeta):
def __init__(self, max_iterations, track_edges):
self.set_... | true | true |
f768d99db36fa1fae0a813e204dbd0346ad6a237 | 652 | py | Python | unit_tests/test_utils_filenames.py | raphaelm/django-parrot | 3b33dced0f465379ab682ef975916b891b869e88 | [
"Apache-2.0"
] | 4 | 2016-04-03T13:47:02.000Z | 2021-12-04T09:55:39.000Z | unit_tests/test_utils_filenames.py | raphaelm/django-parrot | 3b33dced0f465379ab682ef975916b891b869e88 | [
"Apache-2.0"
] | 13 | 2016-04-02T23:04:53.000Z | 2016-07-02T09:35:46.000Z | unit_tests/test_utils_filenames.py | raphaelm/django-parrot | 3b33dced0f465379ab682ef975916b891b869e88 | [
"Apache-2.0"
] | null | null | null | from cockatiel.utils.filenames import generate_filename, get_hash_from_name
def test_filename_checksum():
assert generate_filename('foo/bar/baz.html', 'abcdefghijk12345', 13) == 'foo/bar/baz_13_abcdefghijk12345.html'
assert generate_filename('foo/bar/baz', 'abcdefghijk12345', 13) == 'foo/bar/baz_13_abcdefghij... | 46.571429 | 114 | 0.769939 | from cockatiel.utils.filenames import generate_filename, get_hash_from_name
def test_filename_checksum():
assert generate_filename('foo/bar/baz.html', 'abcdefghijk12345', 13) == 'foo/bar/baz_13_abcdefghijk12345.html'
assert generate_filename('foo/bar/baz', 'abcdefghijk12345', 13) == 'foo/bar/baz_13_abcdefghij... | true | true |
f768d9b044953bbe3aedbab698d2058d675f8bbe | 2,221 | py | Python | Notebooks/utls.py | jaryaman/ML_demos | df270b58d35d1248079e4651988ded4074237bfc | [
"MIT"
] | 2 | 2018-07-28T18:14:12.000Z | 2018-07-31T16:51:10.000Z | Notebooks/utls.py | jaryaman/ML_demos | df270b58d35d1248079e4651988ded4074237bfc | [
"MIT"
] | 3 | 2020-06-21T18:23:19.000Z | 2020-09-28T14:21:39.000Z | Notebooks/utls.py | jaryaman/ML_demos | df270b58d35d1248079e4651988ded4074237bfc | [
"MIT"
] | 1 | 2018-07-02T14:25:20.000Z | 2018-07-02T14:25:20.000Z | import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import matplotlib.ticker
from matplotlib.ticker import FormatStrFormatter
def reset_plots():
plt.close('all')
fontsize = 20
legsize = 15
plt.rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
plt.rc('text', use... | 33.149254 | 93 | 0.687078 | import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import matplotlib.ticker
from matplotlib.ticker import FormatStrFormatter
def reset_plots():
plt.close('all')
fontsize = 20
legsize = 15
plt.rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
plt.rc('text', use... | true | true |
f768da594d9e6d81b773e9880721380941da522e | 7,942 | py | Python | server/.venv/lib/python3.8/site-packages/webassets/filter/cssrewrite/urlpath.py | Cap-n-Proud/roboGarden2 | cdcfaf35a3b819459f6a8026905aca4709c29966 | [
"MIT"
] | null | null | null | server/.venv/lib/python3.8/site-packages/webassets/filter/cssrewrite/urlpath.py | Cap-n-Proud/roboGarden2 | cdcfaf35a3b819459f6a8026905aca4709c29966 | [
"MIT"
] | null | null | null | server/.venv/lib/python3.8/site-packages/webassets/filter/cssrewrite/urlpath.py | Cap-n-Proud/roboGarden2 | cdcfaf35a3b819459f6a8026905aca4709c29966 | [
"MIT"
] | null | null | null | # urlpath.py
# 0.1.0
# 2005/08/20
# Functions that handle url paths.
# Part of Pythonutils
# http://www.voidspace.org.uk/python/pythonutils.html
# Copyright Michael Foord, 2004 & 2005.
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# For information about bugfixe... | 29.414815 | 81 | 0.593931 |
from __future__ import print_function
import posixpath
import os
try:
from urllib.request import url2pathname, pathname2url
except ImportError:
from urllib import url2pathname, pathname2url
__all__ = [
'nativejoin',
'pathjoin',
'relpathto',
'tslash',
'relpath'
]
def pathjoin(base,... | true | true |
f768da73ceb31a2f9fa4af92c44cf1dfdb6776b7 | 3,711 | py | Python | ibrx/client.py | dayfine/ibapi-rxpy | 4f8573a20db8c2d2cafc4c0dc2479bceea7c4fac | [
"Apache-2.0"
] | 2 | 2021-02-21T18:14:29.000Z | 2021-08-12T22:05:27.000Z | ibrx/client.py | dayfine/ibapi-rxpy | 4f8573a20db8c2d2cafc4c0dc2479bceea7c4fac | [
"Apache-2.0"
] | null | null | null | ibrx/client.py | dayfine/ibapi-rxpy | 4f8573a20db8c2d2cafc4c0dc2479bceea7c4fac | [
"Apache-2.0"
] | 2 | 2021-01-04T23:30:21.000Z | 2021-05-09T23:24:57.000Z | from contextlib import ExitStack
import threading
from typing import List
from ibapi import client
from ibapi import account_summary_tags
from ibapi import contract
from ibapi import order
from rx import operators as _
from rx.subject import ReplaySubject
from ibrx.mess import message_wrapper
from ibrx.mess.message i... | 39.063158 | 87 | 0.681487 | from contextlib import ExitStack
import threading
from typing import List
from ibapi import client
from ibapi import account_summary_tags
from ibapi import contract
from ibapi import order
from rx import operators as _
from rx.subject import ReplaySubject
from ibrx.mess import message_wrapper
from ibrx.mess.message i... | true | true |
f768daa3e32bf47f14097b557dbfcc04c8137c82 | 4,169 | py | Python | dsch/backends/inmem.py | emtpb/dsch | ed31b72a95e59335f338ae48bc0c7c0d011e889c | [
"BSD-3-Clause"
] | 2 | 2017-06-04T23:01:57.000Z | 2020-10-10T09:23:44.000Z | dsch/backends/inmem.py | emtpb/dsch | ed31b72a95e59335f338ae48bc0c7c0d011e889c | [
"BSD-3-Clause"
] | null | null | null | dsch/backends/inmem.py | emtpb/dsch | ed31b72a95e59335f338ae48bc0c7c0d011e889c | [
"BSD-3-Clause"
] | 1 | 2018-01-08T16:20:05.000Z | 2018-01-08T16:20:05.000Z | """dsch backend for in-memory data storage.
This backend stores all data in memory and cannot directly save to disk.
For temporary data that does not have to be stored, the in-memory backend
provides a clean way of data with dsch, without littering the workspace with
temporary files. Also, it can be used to collect an... | 30.881481 | 79 | 0.64332 | import numpy as np
from .. import data, storage
class _ItemNode(data.ItemNode):
def replace(self, new_value):
self._storage = new_value
def _value(self):
return self._storage
class Array(data.Array, _ItemNode):
pass
class Bytes(_ItemNode):
pass
... | true | true |
f768df4910061cac597644c3a152e60684e0cb81 | 305 | py | Python | config/routing.py | mohammadalikz/django-channel | 85c8ab702f512e235ad504a74c9352814d6c2427 | [
"MIT"
] | 1 | 2021-12-25T13:25:59.000Z | 2021-12-25T13:25:59.000Z | config/routing.py | mohammadalikz/django-channel | 85c8ab702f512e235ad504a74c9352814d6c2427 | [
"MIT"
] | null | null | null | config/routing.py | mohammadalikz/django-channel | 85c8ab702f512e235ad504a74c9352814d6c2427 | [
"MIT"
] | null | null | null | from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
from echo import routing as echo_routing
application = ProtocolTypeRouter({
'websocket': AuthMiddlewareStack(
URLRouter(
echo_routing.websocket_urlpatterns
)
)
}) | 25.416667 | 58 | 0.744262 | from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
from echo import routing as echo_routing
application = ProtocolTypeRouter({
'websocket': AuthMiddlewareStack(
URLRouter(
echo_routing.websocket_urlpatterns
)
)
}) | true | true |
f768dff8670b22c89b04f9388455967e5e99674d | 1,452 | py | Python | projectile.py | PavelVavruska/binary-space-partitioning | 2f4974b768c19d128a14a0e1da6718c6902edc14 | [
"MIT"
] | null | null | null | projectile.py | PavelVavruska/binary-space-partitioning | 2f4974b768c19d128a14a0e1da6718c6902edc14 | [
"MIT"
] | null | null | null | projectile.py | PavelVavruska/binary-space-partitioning | 2f4974b768c19d128a14a0e1da6718c6902edc14 | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Pavel Vavruska
# 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, publis... | 51.857143 | 82 | 0.747934 | from space.vectors import Vec2d
class Projectile(object):
def __init__(self, position_vec2d, direction_vec2d):
self.position_vec2d = position_vec2d self.direction_vec2d = direction_vec2d
def move(self):
self.position_vec2d.add_vec2d(self.direction_vec2d) | true | true |
f768e14ab6d412dc6d834ffaf99cac6c8b95f3d8 | 6,482 | py | Python | core/utils/envs.py | vslyu/PaddleRec | 0dbbb781d020be4f4e15f1bf1a6551aa310dff51 | [
"Apache-2.0"
] | null | null | null | core/utils/envs.py | vslyu/PaddleRec | 0dbbb781d020be4f4e15f1bf1a6551aa310dff51 | [
"Apache-2.0"
] | null | null | null | core/utils/envs.py | vslyu/PaddleRec | 0dbbb781d020be4f4e15f1bf1a6551aa310dff51 | [
"Apache-2.0"
] | 1 | 2021-11-01T10:33:53.000Z | 2021-11-01T10:33:53.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 28.182609 | 77 | 0.593027 |
from contextlib import closing
import yaml
import copy
import os
import socket
import sys
global_envs = {}
def flatten_environs(envs, separator="."):
flatten_dict = {}
assert isinstance(envs, dict)
def fatten_env_namespace(namespace_nests, local_envs):
if not isinstance(local_envs, dict):
... | true | true |
f768e28be9238f5d99c97fbf3bd6569dedf67214 | 14,336 | py | Python | homeassistant/components/home_connect/api.py | squirrel289/core | 6c5bcbfc3ee40927458e9188d6b79bf63933d3f9 | [
"Apache-2.0"
] | 6 | 2020-07-18T16:33:25.000Z | 2021-09-26T09:52:04.000Z | homeassistant/components/home_connect/api.py | squirrel289/core | 6c5bcbfc3ee40927458e9188d6b79bf63933d3f9 | [
"Apache-2.0"
] | 47 | 2020-07-23T07:14:33.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/home_connect/api.py | squirrel289/core | 6c5bcbfc3ee40927458e9188d6b79bf63933d3f9 | [
"Apache-2.0"
] | 3 | 2020-10-18T07:08:40.000Z | 2021-06-21T02:26:00.000Z | """API for Home Connect bound to HASS OAuth."""
from asyncio import run_coroutine_threadsafe
import logging
import homeconnect
from homeconnect.api import HomeConnectError
from homeassistant import config_entries, core
from homeassistant.const import DEVICE_CLASS_TIMESTAMP, TIME_SECONDS, UNIT_PERCENTAGE
from homeass... | 38.434316 | 93 | 0.636091 |
from asyncio import run_coroutine_threadsafe
import logging
import homeconnect
from homeconnect.api import HomeConnectError
from homeassistant import config_entries, core
from homeassistant.const import DEVICE_CLASS_TIMESTAMP, TIME_SECONDS, UNIT_PERCENTAGE
from homeassistant.helpers import config_entry_oauth2_flow
f... | true | true |
f768e2c16e60d6422281b913e5f4779e32cf79b7 | 3,697 | py | Python | twint/user.py | nicprd/twint | 0f19841b0f2e6456094c6c85b89faf8a0e82f7b1 | [
"MIT"
] | 4 | 2020-03-10T15:05:55.000Z | 2021-03-15T21:29:46.000Z | twint/user.py | paulrobichaud/twint | 3828732b69c2ebeed6dd5b5f922db34e43106c9c | [
"MIT"
] | 1 | 2020-10-05T01:29:59.000Z | 2020-10-05T01:29:59.000Z | twint/user.py | paulrobichaud/twint | 3828732b69c2ebeed6dd5b5f922db34e43106c9c | [
"MIT"
] | 10 | 2020-09-18T16:29:54.000Z | 2020-10-21T17:28:11.000Z | import logging as logme
class user:
type = "user"
def __init__(self):
pass
def inf(ur, _type):
logme.debug(__name__+':inf')
try:
group = ur.find("div", "user-actions btn-group not-following ")
if group == None:
group = ur.find("div", "user-actions btn-group not-fol... | 26.789855 | 98 | 0.542332 | import logging as logme
class user:
type = "user"
def __init__(self):
pass
def inf(ur, _type):
logme.debug(__name__+':inf')
try:
group = ur.find("div", "user-actions btn-group not-following ")
if group == None:
group = ur.find("div", "user-actions btn-group not-fol... | true | true |
f768e2cd9d576386487989bca0a19c1210afdfa6 | 10,245 | py | Python | src/.history/Test/HiwinRT605_Strategy_test_20190625104806.py | SamKaiYang/2019_Hiwin_Shaking | d599f8c87dc4da89eae266990d12eb3a8b0f3e16 | [
"MIT"
] | null | null | null | src/.history/Test/HiwinRT605_Strategy_test_20190625104806.py | SamKaiYang/2019_Hiwin_Shaking | d599f8c87dc4da89eae266990d12eb3a8b0f3e16 | [
"MIT"
] | null | null | null | src/.history/Test/HiwinRT605_Strategy_test_20190625104806.py | SamKaiYang/2019_Hiwin_Shaking | d599f8c87dc4da89eae266990d12eb3a8b0f3e16 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# license removed for brevity
#策略 機械手臂 四點來回跑
import rospy
import os
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import math
import enum
import Hiwin_RT605_Arm_Command as ArmTask
##----Arm state-----------
Arm_state_flag = 0
Strategy... | 30.951662 | 145 | 0.578526 | import rospy
import os
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import math
import enum
import Hiwin_RT605_Arm_Command as ArmTask
Arm_state_flag = 0
Strategy_flag = 0
class Arm_status(enum.IntEnum):
Idle = 0
Isbusy = 1
Error = 2
shutdow... | true | true |
f768e33539269f6667159f2ebef1489335a2ca8e | 489 | py | Python | nordata/__init__.py | Nordstrom/nordata | 935b58f5bcdf100a9211db3bbe7d98a332c81158 | [
"Apache-2.0"
] | 5 | 2019-01-08T20:47:23.000Z | 2020-03-26T02:49:54.000Z | nordata/__init__.py | Nordstrom/nordata | 935b58f5bcdf100a9211db3bbe7d98a332c81158 | [
"Apache-2.0"
] | 3 | 2020-02-04T18:52:40.000Z | 2020-03-31T00:54:05.000Z | nordata/__init__.py | Nordstrom/nordata | 935b58f5bcdf100a9211db3bbe7d98a332c81158 | [
"Apache-2.0"
] | 2 | 2021-06-13T22:47:36.000Z | 2022-02-26T12:52:01.000Z | """Convenience wrappers for connecting to AWS S3 and Redshift"""
__version__ = '0.2.3'
# Boto3 function
from ._boto import boto_get_creds
from ._boto import boto_create_session
# Redshift functions
from ._redshift import redshift_get_conn
from ._redshift import read_sql
from ._redshift import redshift_execute_sql
# ... | 23.285714 | 64 | 0.793456 |
__version__ = '0.2.3'
from ._boto import boto_get_creds
from ._boto import boto_create_session
from ._redshift import redshift_get_conn
from ._redshift import read_sql
from ._redshift import redshift_execute_sql
from ._s3 import s3_get_bucket
from ._s3 import s3_download
from ._s3 import s3_upload
from ._s3 import s... | true | true |
f768e5f60a29e59d39a4fc4d3cb94f9ba0b1f3a0 | 7,212 | py | Python | pytorch_genotypes/vcf.py | legaultmarc/pytorch-genotypes-dataloader | 0cb99f28cbfc5a2787d1d51f1c27e7e31dc23d05 | [
"MIT"
] | null | null | null | pytorch_genotypes/vcf.py | legaultmarc/pytorch-genotypes-dataloader | 0cb99f28cbfc5a2787d1d51f1c27e7e31dc23d05 | [
"MIT"
] | null | null | null | pytorch_genotypes/vcf.py | legaultmarc/pytorch-genotypes-dataloader | 0cb99f28cbfc5a2787d1d51f1c27e7e31dc23d05 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
import collections
import typing
import sqlite3
import os
import cyvcf2
import numpy as np
import torch
VERBOSE = True
def set_verbose(b: bool):
global VERBOSE
VERBOSE = b
@dataclass
class VCFChunk:
chunk_id: int
chrom: str
start: int
end: int
@class... | 28.062257 | 78 | 0.551858 | from dataclasses import dataclass
import collections
import typing
import sqlite3
import os
import cyvcf2
import numpy as np
import torch
VERBOSE = True
def set_verbose(b: bool):
global VERBOSE
VERBOSE = b
@dataclass
class VCFChunk:
chunk_id: int
chrom: str
start: int
end: int
@class... | true | true |
f768e615b34b53dd551f70bbb1599ea0300b1cae | 3,305 | py | Python | demo/demo_vid.py | Chop1/mmtracking | a14fcb31463c96912a34f49e3422309690d62a47 | [
"Apache-2.0"
] | 1 | 2022-03-24T15:18:38.000Z | 2022-03-24T15:18:38.000Z | demo/demo_vid.py | ZhongwenW/mmtracking | fd62f33e399f9931b94dbdb33e201ae348af2cd8 | [
"Apache-2.0"
] | null | null | null | demo/demo_vid.py | ZhongwenW/mmtracking | fd62f33e399f9931b94dbdb33e201ae348af2cd8 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import os
import os.path as osp
import tempfile
from argparse import ArgumentParser
import mmcv
from mmtrack.apis import inference_vid, init_model
def main():
parser = ArgumentParser()
parser.add_argument('config', help='Config file')
parser.add_argument('... | 32.722772 | 78 | 0.590015 | import os
import os.path as osp
import tempfile
from argparse import ArgumentParser
import mmcv
from mmtrack.apis import inference_vid, init_model
def main():
parser = ArgumentParser()
parser.add_argument('config', help='Config file')
parser.add_argument('--input', help='input video file')
parser.ad... | true | true |
f768e6a7c3bec42d5ff269b14d38c09f6f510c6e | 4,311 | py | Python | algorithms/leetcode/medium/0012_整数转罗马数字.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | 1 | 2019-11-25T07:23:42.000Z | 2019-11-25T07:23:42.000Z | algorithms/leetcode/medium/0012_整数转罗马数字.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | 13 | 2020-01-07T16:09:47.000Z | 2022-03-02T12:51:44.000Z | algorithms/leetcode/medium/0012_整数转罗马数字.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# author: bigfoolliu
"""
罗马数字包含以下七种字符: I, V, X, L,C,D 和 M。
字符 数值
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
例如, 罗马数字 2 写做 II ,即为两个并列的 1。12 写做 XII ,即为 X + II 。 27 写做 XXVII, 即为 XX + V +... | 21.994898 | 127 | 0.409418 |
import doctest
class Solution:
def intToRoman(self, num: int) -> str:
THOUSANDS = ["", "M", "MM", "MMM"] HUNDREDS = ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"] TENS = ["", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"] ... | true | true |
f768e705b1b9a5fdecd599135316335333ab8b1b | 1,858 | py | Python | utils/scripts/nes/NESSprites.py | xahmol/8bit-Unity | b4f3bee00e012ca1755afba550a5270dce0a1054 | [
"BSD-2-Clause"
] | 42 | 2018-12-12T01:00:59.000Z | 2022-03-27T07:32:29.000Z | utils/scripts/nes/NESSprites.py | xahmol/8bit-Unity | b4f3bee00e012ca1755afba550a5270dce0a1054 | [
"BSD-2-Clause"
] | 13 | 2020-11-06T13:50:45.000Z | 2022-01-25T07:17:37.000Z | utils/scripts/nes/NESSprites.py | xahmol/8bit-Unity | b4f3bee00e012ca1755afba550a5270dce0a1054 | [
"BSD-2-Clause"
] | 8 | 2020-11-14T04:30:26.000Z | 2021-01-16T17:55:19.000Z | """
* Copyright (c) 2021 Anthony Beaucamp.
*
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from
* the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* in... | 35.056604 | 96 | 0.657158 | """
* Copyright (c) 2021 Anthony Beaucamp.
*
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from
* the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* in... | false | true |
f768e76a5e5e3fd68ee7f18175a5a492e3717f9c | 167 | py | Python | backend/scripts/retrain_models.py | hengwang322/wind_dashboard | 78b0edf1f290b44c617cb0bb009bec19eec13cf6 | [
"MIT"
] | null | null | null | backend/scripts/retrain_models.py | hengwang322/wind_dashboard | 78b0edf1f290b44c617cb0bb009bec19eec13cf6 | [
"MIT"
] | null | null | null | backend/scripts/retrain_models.py | hengwang322/wind_dashboard | 78b0edf1f290b44c617cb0bb009bec19eec13cf6 | [
"MIT"
] | null | null | null | from models import train_models
from data import FARM_LIST
def main():
models = train_models(FARM_LIST)
return models
if __name__ == '__main__':
main()
| 15.181818 | 36 | 0.712575 | from models import train_models
from data import FARM_LIST
def main():
models = train_models(FARM_LIST)
return models
if __name__ == '__main__':
main()
| true | true |
f768e82333de1f8ee01833c0c52ef75265077506 | 274 | py | Python | tests/animation.py | jasontbradshaw/coconut-run | 1442bbc6e59a5ebb34bf587df78b220181479b4f | [
"MIT"
] | null | null | null | tests/animation.py | jasontbradshaw/coconut-run | 1442bbc6e59a5ebb34bf587df78b220181479b4f | [
"MIT"
] | null | null | null | tests/animation.py | jasontbradshaw/coconut-run | 1442bbc6e59a5ebb34bf587df78b220181479b4f | [
"MIT"
] | null | null | null | import sys
import os
sys.path.append( os.path.join( os.getcwd(), '..' ) )
from sprites import Animation
s = ["right foot", "left foot", "turn around", "sit down!"]
a = Animation(s1)
print (len(a) == 4)
print (a.current() == "right foot")
a.next()
print (a.current() == 1)
| 21.076923 | 59 | 0.627737 | import sys
import os
sys.path.append( os.path.join( os.getcwd(), '..' ) )
from sprites import Animation
s = ["right foot", "left foot", "turn around", "sit down!"]
a = Animation(s1)
print (len(a) == 4)
print (a.current() == "right foot")
a.next()
print (a.current() == 1)
| true | true |
f768e839dda30e32b639e68c727d3d541666c827 | 9,595 | py | Python | src/sage/modular/arithgroup/congroup_gamma.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | src/sage/modular/arithgroup/congroup_gamma.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | src/sage/modular/arithgroup/congroup_gamma.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | r"""
Congruence Subgroup `\Gamma(N)`
"""
################################################################################
#
# Copyright (C) 2009, The Sage Group -- http://www.sagemath.org/
#
# Distributed under the terms of the GNU General Public License (GPL)
#
# The full text of the GPL is available at:
#
# ... | 28.641791 | 123 | 0.5111 | r"""
Congruence Subgroup `\Gamma(N)`
"""
from congroup_generic import CongruenceSubgroup
from sage.misc.misc import prod
from sage.rings.all import ZZ, Zmod, gcd, QQ
from sage.rings.integer import GCD_list
from sage.groups.matrix_gps.finitely_generated import MatrixGroup
from sage.matrix.constructor import matrix
fro... | false | true |
f768e84c43f7df8011b95d700c484a1292effe85 | 1,665 | py | Python | scripts/export.py | iscoe/dragonfly | f81f47d990dd5ef1c7cf1bedee8a2d7f9fb84cd3 | [
"Apache-2.0"
] | 6 | 2018-09-12T19:38:13.000Z | 2021-10-02T17:23:47.000Z | scripts/export.py | iscoe/dragonfly | f81f47d990dd5ef1c7cf1bedee8a2d7f9fb84cd3 | [
"Apache-2.0"
] | 49 | 2018-05-23T14:38:23.000Z | 2020-10-29T18:12:39.000Z | scripts/export.py | iscoe/dragonfly | f81f47d990dd5ef1c7cf1bedee8a2d7f9fb84cd3 | [
"Apache-2.0"
] | 3 | 2018-05-20T20:04:09.000Z | 2021-08-10T06:38:16.000Z | #!/usr/bin/env python3
# Copyright 2017-2019, The Johns Hopkins University Applied Physics Laboratory LLC
# All rights reserved.
# Distributed under the terms of the Apache 2.0 License.
#
# Export a translation dictionary
#
# usage: export.py lang
#
# It writes the file [lang].tsv to the current directory.
# The file... | 34.6875 | 102 | 0.747147 |
import argparse
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, 'dragonfly'))
import translations
MIN_PYTHON = (3, 0)
if sys.version_info < MIN_PYTHON:
sys.exit("Python {}.{} or later is required.\n".format(*MIN_PYTHON))
parser = argparse.ArgumentParser()
parser.add_arg... | true | true |
f768e8cce7ac9349661cac025e52271e4b692c25 | 3,163 | py | Python | validate.py | rivinduw/ntf_estimation | 1c4bc7015971081dd880f00940c79776ad1ea63d | [
"MIT"
] | 5,129 | 2019-09-30T11:21:03.000Z | 2022-03-31T22:35:12.000Z | validate.py | rivinduw/ntf_estimation | 1c4bc7015971081dd880f00940c79776ad1ea63d | [
"MIT"
] | 604 | 2019-10-05T00:39:46.000Z | 2022-03-31T11:12:07.000Z | validate.py | rivinduw/ntf_estimation | 1c4bc7015971081dd880f00940c79776ad1ea63d | [
"MIT"
] | 1,034 | 2019-09-30T15:01:32.000Z | 2022-03-31T06:14:50.000Z | #!/usr/bin/env python3 -u
#!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from fairseq import checkpoint_utils, options, progress_bar, utils
def mai... | 31.63 | 88 | 0.655707 |
import torch
from fairseq import checkpoint_utils, options, progress_bar, utils
def main(args, override_args=None):
utils.import_user_module(args)
use_fp16 = args.fp16
use_cuda = torch.cuda.is_available() and not args.cpu
if override_args is not None:
overrides = vars(override_args)
... | true | true |
f768e8e25d3e4f5bef9d50d59f4fa0c17f67d92e | 3,904 | py | Python | backEnd/app/api/auth/auth_utils.py | HenryYDJ/flaskAPI | 9947fbad1050d6ba29c29e365c561689ea3e22d8 | [
"MIT"
] | null | null | null | backEnd/app/api/auth/auth_utils.py | HenryYDJ/flaskAPI | 9947fbad1050d6ba29c29e365c561689ea3e22d8 | [
"MIT"
] | 14 | 2022-03-27T13:34:58.000Z | 2022-03-31T14:37:19.000Z | backEnd/app/api/auth/auth_utils.py | HenryYDJ/flaskAPI | 9947fbad1050d6ba29c29e365c561689ea3e22d8 | [
"MIT"
] | null | null | null | from datetime import datetime, timezone
from functools import wraps
from flask import jsonify
from sqlalchemy.orm.exc import NoResultFound
from flask_jwt_extended import decode_token, verify_jwt_in_request, get_jwt_identity
from app.models import TokenBlacklist, User
from app import db
from .exceptions import Token... | 29.801527 | 118 | 0.654201 | from datetime import datetime, timezone
from functools import wraps
from flask import jsonify
from sqlalchemy.orm.exc import NoResultFound
from flask_jwt_extended import decode_token, verify_jwt_in_request, get_jwt_identity
from app.models import TokenBlacklist, User
from app import db
from .exceptions import Token... | true | true |
f768e9b7c3abc85f3ddc67d7c6ce7e3a38d737f8 | 33,699 | py | Python | Lib/test/test_sys.py | deadsnakes/python3.3 | 4faaf44cd5478410ac3b977351c1965fa054b5e9 | [
"PSF-2.0"
] | 652 | 2015-07-26T00:00:17.000Z | 2022-02-24T18:30:04.000Z | Lib/test/test_sys.py | deadsnakes/python3.3 | 4faaf44cd5478410ac3b977351c1965fa054b5e9 | [
"PSF-2.0"
] | 8 | 2015-09-07T03:38:19.000Z | 2021-05-23T03:18:51.000Z | check-python33-manual/samples/standard_library_337/Lib/test/test_sys.py | DaveKaretnyk/parsing-utils2 | 40085bbd399fa605f2f2a4708d385a64ffc907de | [
"MIT"
] | 40 | 2015-07-24T19:45:08.000Z | 2021-11-01T14:54:56.000Z | import unittest, test.support
from test.script_helper import assert_python_ok, assert_python_failure
import sys, io, os
import struct
import subprocess
import textwrap
import warnings
import operator
import codecs
# count the number of test runs, used to create unique
# strings to intern in test_intern()
numruns = 0
... | 37.779148 | 100 | 0.596605 | import unittest, test.support
from test.script_helper import assert_python_ok, assert_python_failure
import sys, io, os
import struct
import subprocess
import textwrap
import warnings
import operator
import codecs
numruns = 0
try:
import threading
except ImportError:
threading = None
class SysModuleTest(unit... | true | true |
f768eaada83009e5ca5f749e37676503458ff169 | 4,793 | py | Python | eds/openmtc-gevent/common/openmtc/lib/coap/measurement_tools/CoapMeasurements.py | piyush82/elastest-device-emulator-service | b4d6b393d6042c54a7b3dfb5f58cad5efd00f0e7 | [
"Apache-2.0"
] | null | null | null | eds/openmtc-gevent/common/openmtc/lib/coap/measurement_tools/CoapMeasurements.py | piyush82/elastest-device-emulator-service | b4d6b393d6042c54a7b3dfb5f58cad5efd00f0e7 | [
"Apache-2.0"
] | null | null | null | eds/openmtc-gevent/common/openmtc/lib/coap/measurement_tools/CoapMeasurements.py | piyush82/elastest-device-emulator-service | b4d6b393d6042c54a7b3dfb5f58cad5efd00f0e7 | [
"Apache-2.0"
] | null | null | null | #PYTHONPATH=../:../../:../../../src:../../../../futile/src python CoapMeasurements.py
from coap import CoapClient
from coapy.coapy import options
from time import sleep
from timeit import timeit, repeat
from random import randrange
import threading
"""Config Constants"""
#SERVER_HOST = "coap://10.147.65.150"
SERVER_H... | 32.385135 | 120 | 0.581682 | from coap import CoapClient
from coapy.coapy import options
from time import sleep
from timeit import timeit, repeat
from random import randrange
import threading
"""Config Constants"""
SERVER_HOST = "coap://localhost"
SERVER_PORT = 5000
IP = "%s:%s" % (SERVER_HOST, SERVER_PORT)
def reset(filename="data"):
"""C... | false | true |
f768ebac78506a72513b31981bc7befd0510574b | 8,150 | py | Python | pytorch_ssdir/modeling/encoder.py | piotlinski/ssdir | 907b4f00a0747b7e774dc0a342d5a40c4d296fb6 | [
"MIT"
] | null | null | null | pytorch_ssdir/modeling/encoder.py | piotlinski/ssdir | 907b4f00a0747b7e774dc0a342d5a40c4d296fb6 | [
"MIT"
] | null | null | null | pytorch_ssdir/modeling/encoder.py | piotlinski/ssdir | 907b4f00a0747b7e774dc0a342d5a40c4d296fb6 | [
"MIT"
] | null | null | null | """SSDIR encoder."""
from copy import deepcopy
from typing import List, Optional, Tuple
import torch
import torch.nn as nn
from pytorch_ssd.modeling.model import SSD
from pytorch_ssdir.modeling.depth import DepthEncoder
from pytorch_ssdir.modeling.present import PresentEncoder
from pytorch_ssdir.modeling.what import ... | 36.222222 | 87 | 0.605153 | from copy import deepcopy
from typing import List, Optional, Tuple
import torch
import torch.nn as nn
from pytorch_ssd.modeling.model import SSD
from pytorch_ssdir.modeling.depth import DepthEncoder
from pytorch_ssdir.modeling.present import PresentEncoder
from pytorch_ssdir.modeling.what import WhatEncoder
from pyto... | true | true |
f768ebb974f65067d70749c7e80d55cc0acacae5 | 4,018 | py | Python | Input/setups/D100-I12-XUV100.py | jasonleekungfu/KSU.004.NL | ead5e8718f6cecec128605a80c0a985f3fb9971c | [
"MIT"
] | null | null | null | Input/setups/D100-I12-XUV100.py | jasonleekungfu/KSU.004.NL | ead5e8718f6cecec128605a80c0a985f3fb9971c | [
"MIT"
] | null | null | null | Input/setups/D100-I12-XUV100.py | jasonleekungfu/KSU.004.NL | ead5e8718f6cecec128605a80c0a985f3fb9971c | [
"MIT"
] | null | null | null | '''
========================================================================
File Name: setup.py
Author: Jason Li
Description: Input setup file (50 nm Au sphere)
Usage:
========================================================================
'''
#------------------------... | 45.146067 | 72 | 0.371827 |
rs = 25.0 V0 = -13.1 Fermi = -5.1 tauXUV = 200 omegaXUV = 105 IXUV = 1e10 tauIR = 2.47256 omegaIR = 1.722 IIR = 1e12 mfp = 4.4 ... | true | true |
f768ec69116a36e0e18f15ac495a05e21aa0ba9e | 1,694 | py | Python | examples/recursive_dirtree_generator.py | vovanbo/treelib | 8fbdf3332a2dba58171deba0e2dfcce26fdce293 | [
"Apache-2.0"
] | null | null | null | examples/recursive_dirtree_generator.py | vovanbo/treelib | 8fbdf3332a2dba58171deba0e2dfcce26fdce293 | [
"Apache-2.0"
] | null | null | null | examples/recursive_dirtree_generator.py | vovanbo/treelib | 8fbdf3332a2dba58171deba0e2dfcce26fdce293 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Example of ttree usage to generate recursive tree of directories.
It could be useful to implement Directory Tree data structure
2016 samuelsh
"""
import ttree
import random
from hashlib import blake2b
from string import digits, ascii_letters
MAX_FILES_PER_DIR = 10
def get_random_string(l... | 21.443038 | 80 | 0.612161 |
import ttree
import random
from hashlib import blake2b
from string import digits, ascii_letters
MAX_FILES_PER_DIR = 10
def get_random_string(length):
return ''.join(random.choice(digits + ascii_letters) for _ in range(length))
def build_recursive_tree(tree, base, depth, width):
while depth >= 0:
... | true | true |
f768ecab1eb66bffc1dfa0a4c10e6d252ce9a988 | 3,162 | py | Python | usaspending_api/references/helpers.py | Violet26/usaspending-api | 3e2b54662bb27217f4af223d429b09c112a01a5a | [
"CC0-1.0"
] | null | null | null | usaspending_api/references/helpers.py | Violet26/usaspending-api | 3e2b54662bb27217f4af223d429b09c112a01a5a | [
"CC0-1.0"
] | null | null | null | usaspending_api/references/helpers.py | Violet26/usaspending-api | 3e2b54662bb27217f4af223d429b09c112a01a5a | [
"CC0-1.0"
] | null | null | null | from django.db.models import Q
from typing import Optional
from usaspending_api.references.constants import DOD_ARMED_FORCES_CGAC, DOD_ARMED_FORCES_TAS_CGAC_FREC
from usaspending_api.references.models.cgac import CGAC
from usaspending_api.references.models.frec import FREC
def dod_tas_agency_filter(field_name=None, f... | 47.19403 | 113 | 0.751739 | from django.db.models import Q
from typing import Optional
from usaspending_api.references.constants import DOD_ARMED_FORCES_CGAC, DOD_ARMED_FORCES_TAS_CGAC_FREC
from usaspending_api.references.models.cgac import CGAC
from usaspending_api.references.models.frec import FREC
def dod_tas_agency_filter(field_name=None, f... | true | true |
f768ecb131f467602f27264b945be7f149e39b8c | 8,045 | py | Python | prop_management/migrations/0008_auto__add_field_account_property.py | lichong012245/cornerstone | c12735a6dd7b07b95c15a5a88fde9cdd1956cf48 | [
"Unlicense"
] | null | null | null | prop_management/migrations/0008_auto__add_field_account_property.py | lichong012245/cornerstone | c12735a6dd7b07b95c15a5a88fde9cdd1956cf48 | [
"Unlicense"
] | null | null | null | prop_management/migrations/0008_auto__add_field_account_property.py | lichong012245/cornerstone | c12735a6dd7b07b95c15a5a88fde9cdd1956cf48 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Account.property'
db.add_column(u'prop_management_account', 'property',
... | 69.353448 | 167 | 0.566439 | import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column(u'prop_management_account', 'property',
self.gf('django.db.models.fields.related.ForeignKey')(to... | true | true |
f768ed43c074b5848457919e8c3a3b7fa4c84866 | 585 | py | Python | digoie/core/ml/classifier/mla/decision_tree.py | ZwEin27/digoie-annotation | edf01770e26a78267045bba33a54aef3376fa63f | [
"MIT"
] | 1 | 2016-07-01T02:56:50.000Z | 2016-07-01T02:56:50.000Z | digoie/core/ml/classifier/mla/decision_tree.py | ZwEin27/digoie-annotation | edf01770e26a78267045bba33a54aef3376fa63f | [
"MIT"
] | null | null | null | digoie/core/ml/classifier/mla/decision_tree.py | ZwEin27/digoie-annotation | edf01770e26a78267045bba33a54aef3376fa63f | [
"MIT"
] | null | null | null |
from sklearn import tree
from digoie.core.ml.classifier.mla.base import MLAlgorithm
class MLDecisionTree(MLAlgorithm):
# ML_NAME = DECISION_TREE
def __init__(self, training_dataset, training_label):
super(MLDecisionTree, self).__init__(training_dataset, training_label)
def generate(self):
... | 20.172414 | 78 | 0.694017 |
from sklearn import tree
from digoie.core.ml.classifier.mla.base import MLAlgorithm
class MLDecisionTree(MLAlgorithm):
def __init__(self, training_dataset, training_label):
super(MLDecisionTree, self).__init__(training_dataset, training_label)
def generate(self):
classifier = tree.De... | true | true |
f768ed5939a848f57fe33a7e4be86446ebb63266 | 895 | py | Python | LoadModel.py | sujitmandal/Sales-Forecasting | 9052a30f2e3a386eafe36de3e5f1b1205bc1fdf1 | [
"MIT"
] | null | null | null | LoadModel.py | sujitmandal/Sales-Forecasting | 9052a30f2e3a386eafe36de3e5f1b1205bc1fdf1 | [
"MIT"
] | null | null | null | LoadModel.py | sujitmandal/Sales-Forecasting | 9052a30f2e3a386eafe36de3e5f1b1205bc1fdf1 | [
"MIT"
] | null | null | null | #Import required libraries
import os
import pandas as pd
from tensorflow import keras
import matplotlib.pyplot as plt
#Github: https://github.com/sujitmandal
#This programe is create by Sujit Mandal
"""
Github: https://github.com/sujitmandal
Pypi : https://pypi.org/user/sujitmandal/
LinkedIn : https://www.linkedin.com... | 28.870968 | 83 | 0.777654 | import os
import pandas as pd
from tensorflow import keras
import matplotlib.pyplot as plt
unknownData = pd.read_csv('dataset/unknownData.csv',delimiter=';',index_col='date')
unknownDates = unknownData.index
new_model = keras.models.load_model('saved model/vscode/my_model.h5')
new_model.summary()
unknownDatapredict... | true | true |
f768ed5d926511e4864853ba24e4f2892b66deba | 2,578 | py | Python | certbot-nginx/setup.py | abalonan/certbot | ea568d4dc2411214850f04943ffba4e799197f64 | [
"Apache-2.0"
] | null | null | null | certbot-nginx/setup.py | abalonan/certbot | ea568d4dc2411214850f04943ffba4e799197f64 | [
"Apache-2.0"
] | null | null | null | certbot-nginx/setup.py | abalonan/certbot | ea568d4dc2411214850f04943ffba4e799197f64 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
from setuptools import find_packages
from setuptools.command.test import test as TestCommand
import sys
version = '0.33.0.dev0'
# Remember to update local-oldest-requirements.txt when changing the minimum
# acme/certbot version.
install_requires = [
'acme>=0.29.0',
'certbot>=0.33... | 29.295455 | 78 | 0.6218 | from setuptools import setup
from setuptools import find_packages
from setuptools.command.test import test as TestCommand
import sys
version = '0.33.0.dev0'
install_requires = [
'acme>=0.29.0',
'certbot>=0.33.0.dev0',
'mock',
'PyOpenSSL',
'pyparsing>=1.5.5', 'setuptools',
'zope.interface... | true | true |
f768ee6fb5f848846a2ee4a2ad8bed1553ab38e2 | 3,034 | py | Python | eLarning_LMS/curriculum/migrations/0001_initial.py | Sayed-Noman/E-Classroom-LMS | 1f168fd92a265e8bee6ff0fe370114d9a5a1d666 | [
"CC0-1.0"
] | 1 | 2021-07-05T16:56:12.000Z | 2021-07-05T16:56:12.000Z | eLarning_LMS/curriculum/migrations/0001_initial.py | Sayed-Noman/E-Classroom-LMS | 1f168fd92a265e8bee6ff0fe370114d9a5a1d666 | [
"CC0-1.0"
] | null | null | null | eLarning_LMS/curriculum/migrations/0001_initial.py | Sayed-Noman/E-Classroom-LMS | 1f168fd92a265e8bee6ff0fe370114d9a5a1d666 | [
"CC0-1.0"
] | null | null | null | # Generated by Django 3.1.7 on 2021-04-06 15:35
import curriculum.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_US... | 50.566667 | 144 | 0.618655 |
import curriculum.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
mig... | true | true |
f768ee76888748f041bf01a530425f5d96bf7e2d | 3,256 | py | Python | lenstronomywrapper/LensData/lensed_quasar.py | dangilman/LenstronomyWrapper | 7c3bb68ab1f982432cd16d570854df50466491e9 | [
"MIT"
] | null | null | null | lenstronomywrapper/LensData/lensed_quasar.py | dangilman/LenstronomyWrapper | 7c3bb68ab1f982432cd16d570854df50466491e9 | [
"MIT"
] | null | null | null | lenstronomywrapper/LensData/lensed_quasar.py | dangilman/LenstronomyWrapper | 7c3bb68ab1f982432cd16d570854df50466491e9 | [
"MIT"
] | null | null | null | import numpy as np
from lenstronomy.PointSource.point_source import PointSource
import itertools
from copy import deepcopy
class LensedQuasar(object):
def __init__(self, x_image, y_image, mag, t_arrival=None):
"""
Data class for a quadruply-imaged quasar
:param x_image: x image positions... | 30.716981 | 128 | 0.59183 | import numpy as np
from lenstronomy.PointSource.point_source import PointSource
import itertools
from copy import deepcopy
class LensedQuasar(object):
def __init__(self, x_image, y_image, mag, t_arrival=None):
self.x, self.y = x_image, y_image
self.m = mag
self._nimg = len(x_image)
... | true | true |
f768f1cbf1eb5dce78c843ea48d5940e51a94980 | 8,160 | py | Python | django_mako_plus/provider/link.py | BrightBridgeWeb/django-mako-plus | 24690661b80562a510c1632853815df5111b606c | [
"Apache-2.0"
] | null | null | null | django_mako_plus/provider/link.py | BrightBridgeWeb/django-mako-plus | 24690661b80562a510c1632853815df5111b606c | [
"Apache-2.0"
] | null | null | null | django_mako_plus/provider/link.py | BrightBridgeWeb/django-mako-plus | 24690661b80562a510c1632853815df5111b606c | [
"Apache-2.0"
] | null | null | null | from django.core.exceptions import ImproperlyConfigured
from django.conf import settings
from django.forms.utils import flatatt
import logging
import os
import os.path
import posixpath
from ..util import crc32, getdefaultattr
from ..util import log
from .base import BaseProvider
######################################... | 40.197044 | 160 | 0.611275 | from django.core.exceptions import ImproperlyConfigured
from django.conf import settings
from django.forms.utils import flatatt
import logging
import os
import os.path
import posixpath
from ..util import crc32, getdefaultattr
from ..util import log
from .base import BaseProvider
class LinkProvider(BaseProvider):
... | true | true |
f768f1d2525f92fe1a140b73ed505fbce2c5d1c7 | 11,036 | py | Python | src/stages.py | khalidm/hiplexpipe | 6cfbeea8c7dd3a1cde483642adf90e8f5516c797 | [
"MIT"
] | 2 | 2017-12-06T13:49:11.000Z | 2018-04-27T03:10:54.000Z | src/stages.py | khalidm/hiplexpipe | 6cfbeea8c7dd3a1cde483642adf90e8f5516c797 | [
"MIT"
] | null | null | null | src/stages.py | khalidm/hiplexpipe | 6cfbeea8c7dd3a1cde483642adf90e8f5516c797 | [
"MIT"
] | 2 | 2017-12-15T13:55:58.000Z | 2018-01-03T21:27:34.000Z | '''
Individual stages of the pipeline implemented as functions from
input files to output files.
The run_stage function knows everything about submitting jobs and, given
the state parameter, has full access to the state of the pipeline, such
as config, options, DRMAA and the logger.
'''
from utils import safe_make_di... | 51.812207 | 110 | 0.620696 |
from utils import safe_make_dir
from runner import run_stage
import os
PICARD_JAR = '/usr/local/easybuild/software/picard/2.3.0/picard.jar'
SNPEFF_JAR = '/usr/local/easybuild/software/snpEff/4.1d-Java-1.7.0_80/snpEff.jar'
GATK_JAR = '$GATK_HOME/GenomeAnalysisTK.jar'
def java_command(jar_path, mem_in_gb, command_arg... | true | true |
f768f43703b74c9e7c3f7e1c72f3f04b82ebafe8 | 1,096 | py | Python | pytglib/api/types/update_message_mention_read.py | iTeam-co/pytglib | e5e75e0a85f89b77762209b32a61b0a883c0ae61 | [
"MIT"
] | 6 | 2019-10-30T08:57:27.000Z | 2021-02-08T14:17:43.000Z | pytglib/api/types/update_message_mention_read.py | iTeam-co/python-telegram | e5e75e0a85f89b77762209b32a61b0a883c0ae61 | [
"MIT"
] | 1 | 2021-08-19T05:44:10.000Z | 2021-08-19T07:14:56.000Z | pytglib/api/types/update_message_mention_read.py | iTeam-co/python-telegram | e5e75e0a85f89b77762209b32a61b0a883c0ae61 | [
"MIT"
] | 5 | 2019-12-04T05:30:39.000Z | 2021-05-21T18:23:32.000Z |
from ..utils import Object
class UpdateMessageMentionRead(Object):
"""
A message with an unread mention was read
Attributes:
ID (:obj:`str`): ``UpdateMessageMentionRead``
Args:
chat_id (:obj:`int`):
Chat identifier
message_id (:obj:`int`):
Message ... | 26.731707 | 82 | 0.630474 |
from ..utils import Object
class UpdateMessageMentionRead(Object):
ID = "updateMessageMentionRead"
def __init__(self, chat_id, message_id, unread_mention_count, **kwargs):
self.chat_id = chat_id self.message_id = message_id self.unread_mention_count = unread_mention_count... | true | true |
f768f45b88b91f8c6d8010fe496da0cb1dc166ff | 1,332 | py | Python | python_hologram_api/data_plans.py | roekatz/python-hologram-api | 91a732dad0c333d8137b873249c5ff0ede8788c1 | [
"MIT"
] | null | null | null | python_hologram_api/data_plans.py | roekatz/python-hologram-api | 91a732dad0c333d8137b873249c5ff0ede8788c1 | [
"MIT"
] | null | null | null | python_hologram_api/data_plans.py | roekatz/python-hologram-api | 91a732dad0c333d8137b873249c5ff0ede8788c1 | [
"MIT"
] | 1 | 2021-06-21T08:47:32.000Z | 2021-06-21T08:47:32.000Z | """Data Plans module."""
try:
from urllib.parse import urljoin # python 3
except ImportError:
from urlparse import urljoin # python 2
import requests
from furl import furl
class DataPlans(object):
"""DataPlans class.
The Data Plans endpoints return pricing and descriptions for the different
da... | 27.75 | 79 | 0.613363 |
try:
from urllib.parse import urljoin except ImportError:
from urlparse import urljoin import requests
from furl import furl
class DataPlans(object):
def __init__(self, client):
self.client = client
def list(self):
url = urljoin(self.client.base_url, 'plans')
url = furl(ur... | true | true |
f768f50c3bca967fdd6ec6496c23e4f0f722ac16 | 570 | py | Python | env/lib/python3.8/site-packages/plotly/validators/layout/template/data/_densitymapbox.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/lib/python3.8/site-packages/plotly/validators/layout/template/data/_densitymapbox.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/lib/python3.8/site-packages/plotly/validators/layout/template/data/_densitymapbox.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class DensitymapboxValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="densitymapbox", parent_name="layout.template.data", **kwargs
):
super(DensitymapboxValidator, self).__init__(
plotly_name=plotly_n... | 30 | 87 | 0.612281 | import _plotly_utils.basevalidators
class DensitymapboxValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="densitymapbox", parent_name="layout.template.data", **kwargs
):
super(DensitymapboxValidator, self).__init__(
plotly_name=plotly_n... | true | true |
f768f53ed3d818d4f87f83c7c8808f40808edebc | 2,296 | py | Python | test/lmp/script/gen_txt/test_parse_args.py | ProFatXuanAll/char-RNN | 531f101b3d1ba20bafd28ca060aafe6f583d1efb | [
"Beerware"
] | null | null | null | test/lmp/script/gen_txt/test_parse_args.py | ProFatXuanAll/char-RNN | 531f101b3d1ba20bafd28ca060aafe6f583d1efb | [
"Beerware"
] | null | null | null | test/lmp/script/gen_txt/test_parse_args.py | ProFatXuanAll/char-RNN | 531f101b3d1ba20bafd28ca060aafe6f583d1efb | [
"Beerware"
] | null | null | null | """Test parsing arguments.
Test target:
- :py:meth:`lmp.script.gen_txt.parse_args`.
"""
import lmp.infer
import lmp.script.gen_txt
from lmp.infer import Top1Infer, TopKInfer, TopPInfer
def test_top_1_parse_results(ckpt: int, exp_name: str, max_seq_len: int, seed: int) -> None:
"""Must correctly parse all argument... | 23.916667 | 92 | 0.616289 |
import lmp.infer
import lmp.script.gen_txt
from lmp.infer import Top1Infer, TopKInfer, TopPInfer
def test_top_1_parse_results(ckpt: int, exp_name: str, max_seq_len: int, seed: int) -> None:
txt = 'Hello world'
args = lmp.script.gen_txt.parse_args(
argv=[
Top1Infer.infer_name,
'--ckpt',
str(... | true | true |
f768f579d3e2279e1691f6fe0d0a4fc720a5ba60 | 50,104 | py | Python | stage/test_cdh_stages.py | streamsets/datacollector-tests-external | 6f255b5e7496deeef333b57a5e9df4911ba3ef00 | [
"Apache-2.0"
] | 1 | 2020-04-14T03:01:51.000Z | 2020-04-14T03:01:51.000Z | stage/test_cdh_stages.py | streamsets/test | 1ead70179ee92a4acd9cfaa33c56a5a9e233bf3d | [
"Apache-2.0"
] | null | null | null | stage/test_cdh_stages.py | streamsets/test | 1ead70179ee92a4acd9cfaa33c56a5a9e233bf3d | [
"Apache-2.0"
] | 1 | 2019-09-14T08:28:36.000Z | 2019-09-14T08:28:36.000Z | # Copyright 2017 StreamSets Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 53.245484 | 124 | 0.584644 |
import json
import logging
import string
import time
from datetime import datetime
from decimal import Decimal
import pytest
import sqlalchemy
from streamsets.testframework.markers import cluster, sdc_min_version
from streamsets.testframework.utils import get_random_string, Version
logger = logging.getLogger(__name_... | true | true |
f768f68540477e9198d68d865615643badd2a556 | 1,897 | py | Python | output_parsers/inputgui.py | gcampuzano14/PathISTabs | ae29a0b71647ecb32fc40e234b5c7276ab5333d9 | [
"MIT"
] | 1 | 2017-07-28T14:01:32.000Z | 2017-07-28T14:01:32.000Z | output_parsers/inputgui.py | gcampuzano14/PathISTabs | ae29a0b71647ecb32fc40e234b5c7276ab5333d9 | [
"MIT"
] | null | null | null | output_parsers/inputgui.py | gcampuzano14/PathISTabs | ae29a0b71647ecb32fc40e234b5c7276ab5333d9 | [
"MIT"
] | 1 | 2019-02-14T06:07:24.000Z | 2019-02-14T06:07:24.000Z | import os
import re
import datetime
from easygui_labcuro import fileopenbox, diropenbox, enterbox, msgbox
def inputstuff(title, msg_fileopenbox, file_type, file_extension, msg_enterbox):
now = (str(datetime.datetime.now())[0:4] + str(datetime.datetime.now())[5:7] +
str(datetime.datetime.now())[... | 41.23913 | 138 | 0.634686 | import os
import re
import datetime
from easygui_labcuro import fileopenbox, diropenbox, enterbox, msgbox
def inputstuff(title, msg_fileopenbox, file_type, file_extension, msg_enterbox):
now = (str(datetime.datetime.now())[0:4] + str(datetime.datetime.now())[5:7] +
str(datetime.datetime.now())[... | true | true |
f768f70674612c2952c13b5caba5a94846cb2f88 | 5,801 | py | Python | qlib/data/base.py | majiajue/qlib | 93088485c31508f74dc8e19dfc7a55e906ae9024 | [
"MIT"
] | 8,637 | 2020-09-21T05:07:34.000Z | 2022-03-31T10:02:54.000Z | qlib/data/base.py | majiajue/qlib | 93088485c31508f74dc8e19dfc7a55e906ae9024 | [
"MIT"
] | 711 | 2020-09-21T03:32:44.000Z | 2022-03-31T22:18:42.000Z | qlib/data/base.py | majiajue/qlib | 93088485c31508f74dc8e19dfc7a55e906ae9024 | [
"MIT"
] | 1,569 | 2020-09-21T10:21:08.000Z | 2022-03-31T01:14:12.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import division
from __future__ import print_function
import abc
import pandas as pd
from ..log import get_module_logger
class Expression(abc.ABC):
"""Expression base class"""
def __str__(self):
return type(s... | 24.476793 | 100 | 0.605413 |
from __future__ import division
from __future__ import print_function
import abc
import pandas as pd
from ..log import get_module_logger
class Expression(abc.ABC):
def __str__(self):
return type(self).__name__
def __repr__(self):
return str(self)
def __gt__(self, other):
fro... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.