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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f7141e1d70e9c310db82c2be7a2abb0930ea81 | 1,127 | py | Python | code/date.py | RichardHladik/knausj_talon | dc67801a59efc577f9010a2056501f5570bea14d | [
"MIT"
] | 1 | 2020-12-30T00:18:18.000Z | 2020-12-30T00:18:18.000Z | code/date.py | RichardHladik/knausj_talon | dc67801a59efc577f9010a2056501f5570bea14d | [
"MIT"
] | null | null | null | code/date.py | RichardHladik/knausj_talon | dc67801a59efc577f9010a2056501f5570bea14d | [
"MIT"
] | null | null | null | # This follows yyyy-mm-dd format
import datetime
import time
from datetime import date, datetime, timedelta
from talon import Module
mod = Module()
mod.list("weekday", desc="Taskwarrior project")
@mod.action_class
class Actions:
def date_now() -> str:
"""returns the date YYYY-MM-DD and time """
... | 28.897436 | 84 | 0.614907 |
import datetime
import time
from datetime import date, datetime, timedelta
from talon import Module
mod = Module()
mod.list("weekday", desc="Taskwarrior project")
@mod.action_class
class Actions:
def date_now() -> str:
return datetime.today()
def date_today() -> str:
return date.today()
... | true | true |
08f7143dc04f3135061f43f72e73474b040c3e27 | 4,944 | py | Python | logger/writers/file_writer.py | anshika-agarwal/openrvdas | 69c0c53902a988b790faad8baa21a5f299d033df | [
"BSD-2-Clause"
] | null | null | null | logger/writers/file_writer.py | anshika-agarwal/openrvdas | 69c0c53902a988b790faad8baa21a5f299d033df | [
"BSD-2-Clause"
] | null | null | null | logger/writers/file_writer.py | anshika-agarwal/openrvdas | 69c0c53902a988b790faad8baa21a5f299d033df | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
import os.path
import sys
import time
import logging
from datetime import timezone
from os.path import dirname, realpath; sys.path.append(dirname(dirname(dirname(realpath(__file__)))))
from logger.utils.formats import Unknown
from logger.utils.timestamp import time_str, DATE_FORMAT
from logge... | 34.573427 | 101 | 0.633091 |
import os.path
import sys
import time
import logging
from datetime import timezone
from os.path import dirname, realpath; sys.path.append(dirname(dirname(dirname(realpath(__file__)))))
from logger.utils.formats import Unknown
from logger.utils.timestamp import time_str, DATE_FORMAT
from logger.writers.writer import... | true | true |
08f714beafc731fa6a5ec1012cfb731b5d5c010d | 122 | py | Python | CS50x 2021/Week 6/2- PSet 6 Sentimental ' Hello/hello.py | moqdm/CS50x | 7d9a4b4cbe96516383727dc70a1a274f2beb2d28 | [
"MIT"
] | 7 | 2021-10-05T16:06:09.000Z | 2022-03-14T07:02:33.000Z | CS50x 2021/Week 6/2- PSet 6 Sentimental ' Hello/hello.py | moqdm/CS50x | 7d9a4b4cbe96516383727dc70a1a274f2beb2d28 | [
"MIT"
] | null | null | null | CS50x 2021/Week 6/2- PSet 6 Sentimental ' Hello/hello.py | moqdm/CS50x | 7d9a4b4cbe96516383727dc70a1a274f2beb2d28 | [
"MIT"
] | 7 | 2021-10-10T12:35:32.000Z | 2021-12-30T16:03:51.000Z | # Asking name
name = input("What's your name? ")
# Say Hello
print(f"Hello, {name}!")
print("I'm Moqi. Nice to meet you.") | 24.4 | 36 | 0.647541 | name = input("What's your name? ")
# Say Hello
print(f"Hello, {name}!")
print("I'm Moqi. Nice to meet you.") | true | true |
08f715599ebdccb7db7f9153cc150737106850d8 | 6,904 | py | Python | fabric_cf/actor/core/util/resource_count.py | fabric-testbed/ActorBase | 3c7dd040ee79fef0759e66996c93eeec57c790b2 | [
"MIT"
] | null | null | null | fabric_cf/actor/core/util/resource_count.py | fabric-testbed/ActorBase | 3c7dd040ee79fef0759e66996c93eeec57c790b2 | [
"MIT"
] | 67 | 2020-12-21T15:39:49.000Z | 2022-02-27T17:55:00.000Z | fabric_cf/actor/core/util/resource_count.py | fabric-testbed/ControlFramework | 95ab745e32f15c993bc7a017aa97a5a0f67f210f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2020 FABRIC Testbed
#
# 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 ... | 33.033493 | 119 | 0.637167 | from fabric_cf.actor.core.util.resource_type import ResourceType
class CountsPerType:
def __init__(self, *, resource_type: ResourceType):
self.resource_type = resource_type
self.active = 0
self.pending = 0
self.expired = 0
self.failed = 0
self.closed = 0
class Res... | true | true |
08f7157b6960bb524d73aae8dc83bb865618be2d | 76,695 | py | Python | neutron/db/db_base_plugin_v2.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | null | null | null | neutron/db/db_base_plugin_v2.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | null | null | null | neutron/db/db_base_plugin_v2.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 OpenStack Foundation.
# 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... | 47.695896 | 79 | 0.598696 |
import functools
import netaddr
from neutron_lib.api.definitions import ip_allocation as ipalloc_apidef
from neutron_lib.api.definitions import port as port_def
from neutron_lib.api.definitions import subnetpool as subnetpool_def
from neutron_lib.api import validators
from neutron_lib.callbacks import events
from neu... | true | true |
08f71677b4fb45ad219da881a55edcca3f2af64f | 8,528 | py | Python | torchflare/callbacks/callback_decorators.py | Neklaustares-tPtwP/torchflare | 7af6b01ef7c26f0277a041619081f6df4eb1e42c | [
"Apache-2.0"
] | 1 | 2021-09-14T08:38:05.000Z | 2021-09-14T08:38:05.000Z | torchflare/callbacks/callback_decorators.py | Neklaustares-tPtwP/torchflare | 7af6b01ef7c26f0277a041619081f6df4eb1e42c | [
"Apache-2.0"
] | null | null | null | torchflare/callbacks/callback_decorators.py | Neklaustares-tPtwP/torchflare | 7af6b01ef7c26f0277a041619081f6df4eb1e42c | [
"Apache-2.0"
] | 1 | 2021-08-06T19:24:43.000Z | 2021-08-06T19:24:43.000Z | import functools
import types
from typing import TYPE_CHECKING
from torchflare.callbacks.callback import Callbacks
from torchflare.callbacks.states import CallbackOrder
if TYPE_CHECKING:
from torchflare.experiments.experiment import Experiment
class FunctionalCallback(Callbacks):
"""Utility class to call th... | 29.105802 | 118 | 0.663931 | import functools
import types
from typing import TYPE_CHECKING
from torchflare.callbacks.callback import Callbacks
from torchflare.callbacks.states import CallbackOrder
if TYPE_CHECKING:
from torchflare.experiments.experiment import Experiment
class FunctionalCallback(Callbacks):
def __init__(self, func, o... | true | true |
08f717af84100fabb7ee8f843fa8f499d80c3b5a | 3,578 | py | Python | handyrep/daemon/invokable.py | ubiquitousthey/handyrep | 1a6cbc15f79119829e374d8146b50690e00c5266 | [
"PostgreSQL"
] | null | null | null | handyrep/daemon/invokable.py | ubiquitousthey/handyrep | 1a6cbc15f79119829e374d8146b50690e00c5266 | [
"PostgreSQL"
] | null | null | null | handyrep/daemon/invokable.py | ubiquitousthey/handyrep | 1a6cbc15f79119829e374d8146b50690e00c5266 | [
"PostgreSQL"
] | null | null | null | import daemon.daemonfunctions as hrdf
def read_log(numlines=20):
return hrdf.read_log(numlines)
def set_verbose(verbose="True"):
return hrdf.set_verbose(verbose)
def get_setting(category="handyrep", setting=None):
return hrdf.get_setting(category, setting)
def verify_all():
return hrdf.verify_all()
... | 26.503704 | 61 | 0.737842 | import daemon.daemonfunctions as hrdf
def read_log(numlines=20):
return hrdf.read_log(numlines)
def set_verbose(verbose="True"):
return hrdf.set_verbose(verbose)
def get_setting(category="handyrep", setting=None):
return hrdf.get_setting(category, setting)
def verify_all():
return hrdf.verify_all()
... | true | true |
08f717d6d8f7171ceca1eee46d88913dee59a286 | 899 | py | Python | api/picklists/enums.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | 3 | 2019-05-15T09:30:39.000Z | 2020-04-22T16:14:23.000Z | api/picklists/enums.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | 85 | 2019-04-24T10:39:35.000Z | 2022-03-21T14:52:12.000Z | api/picklists/enums.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | 1 | 2021-01-17T11:12:19.000Z | 2021-01-17T11:12:19.000Z | class PicklistType:
PROVISO = "proviso"
ECJU = "ecju_query"
LETTER_PARAGRAPH = "letter_paragraph"
REPORT_SUMMARY = "report_summary"
STANDARD_ADVICE = "standard_advice"
FOOTNOTES = "footnotes"
PRE_VISIT_QUESTIONNAIRE = "pre_visit_questionnaire"
COMPLIANCE_ACTIONS = "compliance_actions"
... | 29 | 84 | 0.647386 | class PicklistType:
PROVISO = "proviso"
ECJU = "ecju_query"
LETTER_PARAGRAPH = "letter_paragraph"
REPORT_SUMMARY = "report_summary"
STANDARD_ADVICE = "standard_advice"
FOOTNOTES = "footnotes"
PRE_VISIT_QUESTIONNAIRE = "pre_visit_questionnaire"
COMPLIANCE_ACTIONS = "compliance_actions"
... | true | true |
08f71a5439f6c31a5d552c6042ae62b84aa7b645 | 4,860 | py | Python | scripts/plot.py | pasta41/decameron | 9b9607077d5a36d231187fc421f8f1474f61b9fa | [
"BSD-3-Clause"
] | null | null | null | scripts/plot.py | pasta41/decameron | 9b9607077d5a36d231187fc421f8f1474f61b9fa | [
"BSD-3-Clause"
] | null | null | null | scripts/plot.py | pasta41/decameron | 9b9607077d5a36d231187fc421f8f1474f61b9fa | [
"BSD-3-Clause"
] | null | null | null | from collections import defaultdict
from datetime import datetime
import math
from operator import itemgetter
import os
import random
import re
import numpy as np
import pandas as pd
import little_mallet_wrapper as lmw
import pdb
import seaborn as sns
import matplotlib.pyplot as plt
import constants
root = "/home/c... | 42.26087 | 119 | 0.753086 | from collections import defaultdict
from datetime import datetime
import math
from operator import itemgetter
import os
import random
import re
import numpy as np
import pandas as pd
import little_mallet_wrapper as lmw
import pdb
import seaborn as sns
import matplotlib.pyplot as plt
import constants
root = "/home/c... | true | true |
08f71b04481ac28cb19a970d1f2d4fb2926b575f | 373 | py | Python | tests/test_with.py | ryanraaum/oldowan.nexus | abf4fda61ab69d322bfbb580f491b2e143ce9c00 | [
"MIT"
] | null | null | null | tests/test_with.py | ryanraaum/oldowan.nexus | abf4fda61ab69d322bfbb580f491b2e143ce9c00 | [
"MIT"
] | null | null | null | tests/test_with.py | ryanraaum/oldowan.nexus | abf4fda61ab69d322bfbb580f491b2e143ce9c00 | [
"MIT"
] | null | null | null | from __future__ import with_statement
import os
from oldowan.nexus.nexus import nexus
SIMPLE_FILEPATH = os.path.join(os.path.dirname(__file__),
'test_files', 'simple.nexus')
def test_with():
"""test of with statement hooks"""
with nexus(SIMPLE_FILEPATH, 'r') as f:
for entry in f:
... | 23.3125 | 58 | 0.680965 | from __future__ import with_statement
import os
from oldowan.nexus.nexus import nexus
SIMPLE_FILEPATH = os.path.join(os.path.dirname(__file__),
'test_files', 'simple.nexus')
def test_with():
with nexus(SIMPLE_FILEPATH, 'r') as f:
for entry in f:
assert isinstance(entry, dict)
as... | true | true |
08f71bd2a9ffac4645eaf2f77a8fb5a16ef4118c | 740 | py | Python | World 03/Class 17/ex080.py | DanielRios549/PythonExcercises | acb44a7cc383e8534f47bc59235d9cc04fd83880 | [
"MIT"
] | 6 | 2021-05-04T22:09:16.000Z | 2022-01-08T20:27:39.000Z | World 03/Class 17/ex080.py | DanielRios549/PythonExercises | acb44a7cc383e8534f47bc59235d9cc04fd83880 | [
"MIT"
] | null | null | null | World 03/Class 17/ex080.py | DanielRios549/PythonExercises | acb44a7cc383e8534f47bc59235d9cc04fd83880 | [
"MIT"
] | null | null | null | '''
Get 5 values and put them in a list, respecting the ascendent order.
In the end, show the list ordered.
'''
numbers = []
for count in range(0, 5):
number = int(input('Choose a number: '))
if count == 0 or number >= max(numbers):
numbers.append(number)
print('Adding in the \033[31m... | 26.428571 | 72 | 0.560811 |
numbers = []
for count in range(0, 5):
number = int(input('Choose a number: '))
if count == 0 or number >= max(numbers):
numbers.append(number)
print('Adding in the \033[31mend\033[m')
elif number <= min(numbers):
numbers.insert(0, number)
print('Adding in the \033[32mstar... | true | true |
08f71bd8e5c33a4c7fc9507e9aaf600e6520ee46 | 16,268 | py | Python | tensorflow/python/ops/tensor_array_ops.py | breandan/tensorflow | 7509bad95200e1baed4eb488dbeaaa2c505a2824 | [
"Apache-2.0"
] | 4 | 2016-09-26T08:55:23.000Z | 2019-05-06T15:26:03.000Z | tensorflow/python/ops/tensor_array_ops.py | breandan/tensorflow | 7509bad95200e1baed4eb488dbeaaa2c505a2824 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/tensor_array_ops.py | breandan/tensorflow | 7509bad95200e1baed4eb488dbeaaa2c505a2824 | [
"Apache-2.0"
] | 8 | 2017-04-17T23:39:12.000Z | 2019-05-11T14:06:31.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.056948 | 80 | 0.685272 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import dtypes as _dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.framework import tensor_util
fr... | true | true |
08f71ca84c16b076df8433cb675f588eddde86e5 | 23,997 | py | Python | statsmodels/tsa/vector_ar/svar_model.py | haribharadwaj/statsmodels | 8675b890607fe6f116b1186dcba4c387c5e3778a | [
"BSD-3-Clause"
] | null | null | null | statsmodels/tsa/vector_ar/svar_model.py | haribharadwaj/statsmodels | 8675b890607fe6f116b1186dcba4c387c5e3778a | [
"BSD-3-Clause"
] | null | null | null | statsmodels/tsa/vector_ar/svar_model.py | haribharadwaj/statsmodels | 8675b890607fe6f116b1186dcba4c387c5e3778a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Vector Autoregression (VAR) processes
References
----------
Lütkepohl (2005) New Introduction to Multiple Time Series Analysis
"""
from __future__ import print_function, division
from statsmodels.compat.python import range
import numpy as np
import numpy.linalg as npl
from numpy.linalg imp... | 32.47226 | 84 | 0.536192 | from __future__ import print_function, division
from statsmodels.compat.python import range
import numpy as np
import numpy.linalg as npl
from numpy.linalg import slogdet
from statsmodels.tools.numdiff import (approx_hess, approx_fprime)
from statsmodels.tools.decorators import cache_readonly
from statsmodels.tsa.vec... | true | true |
08f71d336b3f6d73b7d15eb5e6f7791e675f4719 | 3,340 | py | Python | RTG_proj/Vendor/bullet/examples/pybullet/examples/vr_kuka_control.py | Blitzdude/RealTimeGraphics-engine | 0a92467f7ab9710aabe14f8d4bb25c51f277ed26 | [
"Unlicense",
"MIT"
] | 6 | 2017-09-05T16:57:09.000Z | 2017-10-12T21:36:09.000Z | examples/pybullet/examples/vr_kuka_control.py | ehumss/bullet3 | 0be7584eee07e81dd77087808d53fa077128803c | [
"Zlib"
] | 2 | 2018-02-02T21:26:09.000Z | 2018-02-06T19:05:24.000Z | examples/pybullet/examples/vr_kuka_control.py | ehumss/bullet3 | 0be7584eee07e81dd77087808d53fa077128803c | [
"Zlib"
] | 6 | 2017-06-04T22:43:37.000Z | 2019-07-15T05:36:11.000Z | ## Assume you have run vr_kuka_setup and have default scene set up
# Require p.setInternalSimFlags(0) in kuka_setup
import pybullet as p
import math
# import numpy as np
p.connect(p.SHARED_MEMORY)
kuka = 3
kuka_gripper = 7
POSITION = 1
ORIENTATION = 2
BUTTONS = 6
THRESHOLD = 1.3
LOWER_LIMITS = [-.967, -2.0, -2.96, 0... | 33.4 | 146 | 0.696407 | import pybullet as p
import math
p.connect(p.SHARED_MEMORY)
kuka = 3
kuka_gripper = 7
POSITION = 1
ORIENTATION = 2
BUTTONS = 6
THRESHOLD = 1.3
LOWER_LIMITS = [-.967, -2.0, -2.96, 0.19, -2.96, -2.09, -3.05]
UPPER_LIMITS = [.96, 2.0, 2.96, 2.29, 2.96, 2.09, 3.05]
JOINT_RANGE = [5.8, 4, 5.8, 4, 5.8, 4, 6]
REST_POSE = [... | true | true |
08f71e4c4592c7d0dc3ccd31a1ee7f7192060331 | 11,102 | py | Python | lib/rapi/testutils.py | modulus-sa/ganeti | 592c0e945cc2c7b0013f813ea8c9d8ec0d5bab98 | [
"BSD-2-Clause"
] | 396 | 2015-01-22T11:44:32.000Z | 2022-03-31T14:14:29.000Z | lib/rapi/testutils.py | modulus-sa/ganeti | 592c0e945cc2c7b0013f813ea8c9d8ec0d5bab98 | [
"BSD-2-Clause"
] | 1,550 | 2015-04-05T09:53:50.000Z | 2022-03-28T17:42:20.000Z | lib/rapi/testutils.py | modulus-sa/ganeti | 592c0e945cc2c7b0013f813ea8c9d8ec0d5bab98 | [
"BSD-2-Clause"
] | 119 | 2015-01-06T21:37:15.000Z | 2022-03-07T06:36:26.000Z | #
#
# Copyright (C) 2012 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and ... | 27.755 | 79 | 0.688254 |
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
import base64
import logging
import re
from io import StringIO
import pycurl
from ganeti import errors
from ganeti import opcodes
from ganeti import http
from ganeti import server
from ganeti import utils
from ganeti import compat
from ganet... | true | true |
08f71e6a626cc1f75841312efd7e76f1f28a9809 | 2,167 | py | Python | tests/unit/test_services/test_tag_service.py | Tserewara/dama-rowahutu | 9f8d0ecfa8760cf25efb343472734042a4b2fa15 | [
"MIT"
] | 2 | 2021-03-19T11:19:14.000Z | 2021-05-04T19:02:34.000Z | tests/unit/test_services/test_tag_service.py | Tserewara/dama-rowahutu | 9f8d0ecfa8760cf25efb343472734042a4b2fa15 | [
"MIT"
] | null | null | null | tests/unit/test_services/test_tag_service.py | Tserewara/dama-rowahutu | 9f8d0ecfa8760cf25efb343472734042a4b2fa15 | [
"MIT"
] | 1 | 2021-03-03T17:33:12.000Z | 2021-03-03T17:33:12.000Z | import pytest
from src.articles.domain.entities import tag, exceptions
from src.articles.services import tag_service
from tests.unit.test_services.fakes import FakeUnitOfWork
def test_service_can_add_tag():
uow = FakeUnitOfWork()
tag_name = tag_service.add_tag('verbos', uow)
assert tag_name == 'verbos'... | 23.813187 | 79 | 0.684818 | import pytest
from src.articles.domain.entities import tag, exceptions
from src.articles.services import tag_service
from tests.unit.test_services.fakes import FakeUnitOfWork
def test_service_can_add_tag():
uow = FakeUnitOfWork()
tag_name = tag_service.add_tag('verbos', uow)
assert tag_name == 'verbos'... | true | true |
08f71f7df53eba5d1fe276e97dfda5236a650c5f | 466 | py | Python | categories/models.py | HamelBarrer/store | 89c90807966285df0b6d9ec3a5aaae1dbb952cad | [
"MIT"
] | null | null | null | categories/models.py | HamelBarrer/store | 89c90807966285df0b6d9ec3a5aaae1dbb952cad | [
"MIT"
] | 9 | 2021-03-19T00:58:28.000Z | 2022-03-12T00:19:38.000Z | categories/models.py | HamelBarrer/store | 89c90807966285df0b6d9ec3a5aaae1dbb952cad | [
"MIT"
] | null | null | null | from django.db import models
from products.models import Product
# Create your models here.
class Category(models.Model):
title = models.CharField(max_length=50)
description = models.TextField()
products = models.ManyToManyField(Product, blank=True)
created_at = models.DateTimeField(auto_now_add=True)... | 25.888889 | 58 | 0.718884 | from django.db import models
from products.models import Product
class Category(models.Model):
title = models.CharField(max_length=50)
description = models.TextField()
products = models.ManyToManyField(Product, blank=True)
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
v... | true | true |
08f721348a3646d156e908bc3bfc0b58605dba96 | 1,131 | py | Python | test/functional/sapling_wallet_persistence.py | martin-braun/VTN | 798dd45f0d3800adfa7d2b0b5d7f3588a698ac9a | [
"MIT"
] | 1 | 2022-01-15T21:41:48.000Z | 2022-01-15T21:41:48.000Z | test/functional/sapling_wallet_persistence.py | martin-braun/VTN | 798dd45f0d3800adfa7d2b0b5d7f3588a698ac9a | [
"MIT"
] | null | null | null | test/functional/sapling_wallet_persistence.py | martin-braun/VTN | 798dd45f0d3800adfa7d2b0b5d7f3588a698ac9a | [
"MIT"
] | 1 | 2022-01-10T22:13:33.000Z | 2022-01-10T22:13:33.000Z | #!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 20202 The PIVX developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import voltnoteTestFramework
from test_f... | 37.7 | 87 | 0.727675 |
from test_framework.test_framework import voltnoteTestFramework
from test_framework.util import *
class SaplingWalletPersistenceTest(voltnoteTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
def run_test(self):
sapling_addr = self.nodes[0].ge... | true | true |
08f72164af9a87bb0a8c797bbf834ec588fe7166 | 4,680 | py | Python | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_container_refresh_operation_results_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_container_refresh_operation_results_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_container_refresh_operation_results_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.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 ... | 45.436893 | 210 | 0.676923 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from .. import models
class ProtectionContainerRefreshOperationResultsOperations(object):
models = models
def __init__(self, client, config, serializer, deserializer):
self._client = clie... | true | true |
08f721821cf2bd8399e67980df3c894cb4185548 | 1,322 | py | Python | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/jcq/apis/DescribeAccessPointRequest.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/jcq/apis/DescribeAccessPointRequest.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/jcq/apis/DescribeAccessPointRequest.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | 30.045455 | 90 | 0.71407 |
from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest
class DescribeAccessPointRequest(JDCloudRequest):
def __init__(self, parameters, header=None, version="v1"):
super(DescribeAccessPointRequest, self).__init__(
'/regions/{regionId}/topics/{topicName}/accessPoints', 'GET', header, ver... | true | true |
08f722380e4371b0a598a3f31cc55cc588eb7032 | 3,693 | py | Python | abb_python/src/models.py | karim174/brain-computer-interface-and-vision-based-autonomous-agent-for-shared-control-over-robotic-arm | d099cad43bfb98261c2571991f4e163d444b62b4 | [
"MIT"
] | 2 | 2019-02-28T01:47:23.000Z | 2021-04-10T14:37:46.000Z | abb_python/src/models.py | karim174/brain-computer-interface-and-vision-based-autonomous-agent-for-shared-control-over-robotic-arm | d099cad43bfb98261c2571991f4e163d444b62b4 | [
"MIT"
] | null | null | null | abb_python/src/models.py | karim174/brain-computer-interface-and-vision-based-autonomous-agent-for-shared-control-over-robotic-arm | d099cad43bfb98261c2571991f4e163d444b62b4 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
import numpy as np
import tensorflow.contrib.slim as slim
from gym import spaces
from Networks import P_Network
from Networks import Q_Network
from ray.rlli... | 61.55 | 151 | 0.521527 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
import numpy as np
import tensorflow.contrib.slim as slim
from gym import spaces
from Networks import P_Network
from Networks import Q_Network
from ray.rlli... | true | true |
08f722ea45aba23de8aafc1ecf7b3d183af0f083 | 3,962 | py | Python | tests/test_settings.py | mom1/project-semantic-release | e6133a3ca53753b186520bba533ec05147784f52 | [
"MIT"
] | 2 | 2022-01-21T18:05:38.000Z | 2022-01-31T12:57:25.000Z | tests/test_settings.py | mom1/project-semantic-release | e6133a3ca53753b186520bba533ec05147784f52 | [
"MIT"
] | 27 | 2022-01-21T15:18:25.000Z | 2022-03-31T05:29:53.000Z | tests/test_settings.py | mom1/project-semantic-release | e6133a3ca53753b186520bba533ec05147784f52 | [
"MIT"
] | null | null | null | import os
import platform
from textwrap import dedent
from unittest import TestCase
from semantic_release.errors import ImproperConfigurationError
from semantic_release.history import parser_angular
from semantic_release.settings import _config, import_from_settings
from . import mock, reset_config, wrapped_config_ge... | 39.227723 | 118 | 0.705452 | import os
import platform
from textwrap import dedent
from unittest import TestCase
from semantic_release.errors import ImproperConfigurationError
from semantic_release.history import parser_angular
from semantic_release.settings import _config, import_from_settings
from . import mock, reset_config, wrapped_config_ge... | true | true |
08f7241ae230b79266b4cf447667fef4527b0ee3 | 1,080 | py | Python | python/Testing/app_cloth.py | hanxingyixue/peridyno | 5c963dae20384f6af7a15866dac0d06adfcba236 | [
"Apache-2.0"
] | 2 | 2022-01-29T08:51:50.000Z | 2022-02-22T12:07:09.000Z | python/Testing/app_cloth.py | hanxingyixue/peridyno | 5c963dae20384f6af7a15866dac0d06adfcba236 | [
"Apache-2.0"
] | null | null | null | python/Testing/app_cloth.py | hanxingyixue/peridyno | 5c963dae20384f6af7a15866dac0d06adfcba236 | [
"Apache-2.0"
] | null | null | null | import PyPeridyno as dyno
scn = dyno.SceneGraph()
cloth = dyno.Cloth3f()
cloth.load_particles("../../data/cloth/cloth.obj")
cloth.load_surface("../../data/cloth/cloth.obj")
scn.add_node(cloth)
boundary = dyno.StaticBoundary3f()
boundary.load_cube(dyno.Vector3f([0, 0, 0]), dyno.Vector3f([1.0, 1.0, 1.0]), 0.005, True)... | 30.857143 | 89 | 0.780556 | import PyPeridyno as dyno
scn = dyno.SceneGraph()
cloth = dyno.Cloth3f()
cloth.load_particles("../../data/cloth/cloth.obj")
cloth.load_surface("../../data/cloth/cloth.obj")
scn.add_node(cloth)
boundary = dyno.StaticBoundary3f()
boundary.load_cube(dyno.Vector3f([0, 0, 0]), dyno.Vector3f([1.0, 1.0, 1.0]), 0.005, True)... | true | true |
08f72611ea34bda4021521b442b16d1eef0ec909 | 110 | py | Python | sandbox/views.py | managedbyq/cid | 211d57700e9d9e10d3688cd1874f9e2de3fe6059 | [
"BSD-3-Clause"
] | null | null | null | sandbox/views.py | managedbyq/cid | 211d57700e9d9e10d3688cd1874f9e2de3fe6059 | [
"BSD-3-Clause"
] | null | null | null | sandbox/views.py | managedbyq/cid | 211d57700e9d9e10d3688cd1874f9e2de3fe6059 | [
"BSD-3-Clause"
] | null | null | null | from django.http import HttpResponse
def ping_view(request, *args, **kwargs):
return HttpResponse('OK')
| 18.333333 | 40 | 0.736364 | from django.http import HttpResponse
def ping_view(request, *args, **kwargs):
return HttpResponse('OK')
| true | true |
08f7278baa3955cd66743a6452c0ef1a56066378 | 223 | py | Python | walletweb/resources.py | alaasalman/moneytracker | cba9844f0abd31959e0f4b6343bc72e5235aa5b0 | [
"MIT"
] | null | null | null | walletweb/resources.py | alaasalman/moneytracker | cba9844f0abd31959e0f4b6343bc72e5235aa5b0 | [
"MIT"
] | 10 | 2020-04-22T08:15:43.000Z | 2021-06-10T19:58:46.000Z | walletweb/resources.py | alaasalman/moneytracker | cba9844f0abd31959e0f4b6343bc72e5235aa5b0 | [
"MIT"
] | null | null | null | from import_export import resources
from walletweb import models
class TransactionResource(resources.ModelResource):
class Meta:
model = models.Transaction
fields = ('amount', 'description', 'date')
| 20.272727 | 51 | 0.721973 | from import_export import resources
from walletweb import models
class TransactionResource(resources.ModelResource):
class Meta:
model = models.Transaction
fields = ('amount', 'description', 'date')
| true | true |
08f727cf9271341fad3db1dc738242e538c6ba4c | 10,296 | py | Python | bot/drifter_db.py | IUNetSci/DrifterBot | 05c502fcf9a626321ca20ff83c7c7e5e03cd221d | [
"MIT"
] | 13 | 2020-05-28T21:18:26.000Z | 2022-02-21T09:19:23.000Z | bot/drifter_db.py | IUNetSci/DrifterBot | 05c502fcf9a626321ca20ff83c7c7e5e03cd221d | [
"MIT"
] | 5 | 2020-05-20T23:15:49.000Z | 2020-05-27T00:32:36.000Z | bot/drifter_db.py | IUNetSci/DrifterBot | 05c502fcf9a626321ca20ff83c7c7e5e03cd221d | [
"MIT"
] | 8 | 2020-08-17T10:52:12.000Z | 2022-01-20T15:48:15.000Z | """Manage all commands related to the database, psql."""
import time
from config_stat import conn_save_freq, mashape_key, twitter_app_auth, unfollow_method
from datetime import datetime
from datetime import timedelta
import debug
import json
import source
import sys
import psycopg2
from psycopg2.extensions import AsIs
... | 32.479495 | 114 | 0.615676 | import time
from config_stat import conn_save_freq, mashape_key, twitter_app_auth, unfollow_method
from datetime import datetime
from datetime import timedelta
import debug
import json
import source
import sys
import psycopg2
from psycopg2.extensions import AsIs
class DataManager(object):
def __init__(self, userna... | true | true |
08f7284448db612001e3a2943accd9c878302e98 | 619 | py | Python | exp/mixins/paginator_mixin.py | rhodricusack/lookit-api | 6591bda6d5e408223a0428fa7da6fd86d4c01386 | [
"MIT"
] | null | null | null | exp/mixins/paginator_mixin.py | rhodricusack/lookit-api | 6591bda6d5e408223a0428fa7da6fd86d4c01386 | [
"MIT"
] | null | null | null | exp/mixins/paginator_mixin.py | rhodricusack/lookit-api | 6591bda6d5e408223a0428fa7da6fd86d4c01386 | [
"MIT"
] | null | null | null | from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
class PaginatorMixin(object):
"""Mixin to add pagination to querysets"""
paginator_class = Paginator
def paginated_queryset(self, resource_list, page=1, count=10):
""" Returns a page object with a subset of the queryset"""
... | 32.578947 | 72 | 0.673667 | from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
class PaginatorMixin(object):
paginator_class = Paginator
def paginated_queryset(self, resource_list, page=1, count=10):
paginator = self.paginator_class(resource_list, count)
try:
results = paginator.page(p... | true | true |
08f7296bbfd879b564ab1f04457366642311ad45 | 643 | py | Python | venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pyopencl.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 12 | 2020-12-15T15:12:06.000Z | 2022-03-18T16:17:42.000Z | venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pyopencl.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pyopencl.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 10 | 2020-12-15T15:12:14.000Z | 2022-02-09T21:02:17.000Z | # ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE.GPL.txt, distributed with
# this software.
#
# SPD... | 35.722222 | 69 | 0.608087 |
from PyInstaller.utils.hooks import copy_metadata, collect_data_files
datas = copy_metadata('pyopencl')
datas += collect_data_files('pyopencl')
| true | true |
08f7298781a5a9d843801df9aeb4a09fba5c0a3c | 5,935 | py | Python | export.py | jessedp/tut | 6864f953e3dacd800c9f5a50cec7221e89d47f7d | [
"MIT"
] | 4 | 2020-01-24T21:40:36.000Z | 2021-09-10T22:30:17.000Z | export.py | jessedp/tut | 6864f953e3dacd800c9f5a50cec7221e89d47f7d | [
"MIT"
] | null | null | null | export.py | jessedp/tut | 6864f953e3dacd800c9f5a50cec7221e89d47f7d | [
"MIT"
] | 1 | 2021-09-11T09:36:46.000Z | 2021-09-11T09:36:46.000Z | import gevent
import os
import contextlib
import shutil
import socket
import tempfile
import logging
from tqdm import tqdm
import ffmpeg
from tinydb import TinyDB, Query
from config import built_ins
from recording import Recording
logger = logging.getLogger(__name__)
def copy(id_list, args):
total = len(id_l... | 31.236842 | 77 | 0.582477 | import gevent
import os
import contextlib
import shutil
import socket
import tempfile
import logging
from tqdm import tqdm
import ffmpeg
from tinydb import TinyDB, Query
from config import built_ins
from recording import Recording
logger = logging.getLogger(__name__)
def copy(id_list, args):
total = len(id_l... | true | true |
08f72a4c6419c183a55de97f0b1019ce65077a0b | 8,365 | py | Python | assignment1/q4_sentiment.py | vwozhaoxin/cs224n_homework | 202c571e1e0ed378d0353bb263c1e3e59c118aef | [
"MIT"
] | null | null | null | assignment1/q4_sentiment.py | vwozhaoxin/cs224n_homework | 202c571e1e0ed378d0353bb263c1e3e59c118aef | [
"MIT"
] | null | null | null | assignment1/q4_sentiment.py | vwozhaoxin/cs224n_homework | 202c571e1e0ed378d0353bb263c1e3e59c118aef | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-*- coding:utf8-*-
import argparse
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import itertools
from utils.treebank import StanfordSentiment
import utils.glove as glove
from q3_sgd import load_saved_params, sgd
# We will use sklearn here because ... | 31.806084 | 80 | 0.62893 |
import argparse
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import itertools
from utils.treebank import StanfordSentiment
import utils.glove as glove
from q3_sgd import load_saved_params, sgd
from sklearn.linear_model import LogisticRegression
from sklearn.metrics impo... | true | true |
08f72b1bf212c85033a370f50cba88da924a0e21 | 8,497 | py | Python | {{cookiecutter.project_slug}}/tests/test_{{cookiecutter.project_slug}}.py | FernLab/cookiecutter-pypackage | b8f451102f6df2f2acf3262553e5bc6bdbcbd606 | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/tests/test_{{cookiecutter.project_slug}}.py | FernLab/cookiecutter-pypackage | b8f451102f6df2f2acf3262553e5bc6bdbcbd606 | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/tests/test_{{cookiecutter.project_slug}}.py | FernLab/cookiecutter-pypackage | b8f451102f6df2f2acf3262553e5bc6bdbcbd606 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""Tests for `{{ cookiecutter.project_slug }}` package."""
{% if cookiecutter.open_source_license == 'MIT license' -%}
# {{ cookiecutter.project_name }}, {{ cookiecutter.project_short_description }}
#
# Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.full_name }} (GFZ Potsdam, {{ cookiecu... | 45.438503 | 111 | 0.730375 |
"""Tests for `{{ cookiecutter.project_slug }}` package."""
{% if cookiecutter.open_source_license == 'MIT license' -%}
{% elif cookiecutter.open_source_license == 'BSD license' %}
{% elif cookiecutter.open_source_license == 'ISC license' -%}
{% elif cookiecutter.open_source_license == 'Apache Software License 2.0' -%... | false | true |
08f72be9a8403f77077aed2e702743e090df7d8b | 1,631 | py | Python | account/models.py | DomineCore/Lteach | 8a43d04b2ddd0eb6bb4850dfe96f1fe54bea44ff | [
"MIT"
] | null | null | null | account/models.py | DomineCore/Lteach | 8a43d04b2ddd0eb6bb4850dfe96f1fe54bea44ff | [
"MIT"
] | null | null | null | account/models.py | DomineCore/Lteach | 8a43d04b2ddd0eb6bb4850dfe96f1fe54bea44ff | [
"MIT"
] | null | null | null | import hashlib
from pyexpat import model
from django.conf import settings
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.translation import gettext_lazy as _
class User(AbstractUser):
openid = models.CharField(
verbose_name=_('微信OpenID'), help_text=_('微信... | 46.6 | 115 | 0.668302 | import hashlib
from pyexpat import model
from django.conf import settings
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.translation import gettext_lazy as _
class User(AbstractUser):
openid = models.CharField(
verbose_name=_('微信OpenID'), help_text=_('微信... | true | true |
08f72cd5fd00aaa884944c122c12037cf26db7cf | 16,725 | py | Python | ReClassMap.py | 70RMUND/ReclassMap | 5ecb13087b075441d2e2482cee4203a66bdba30e | [
"MIT"
] | 10 | 2017-12-26T23:15:29.000Z | 2021-07-06T10:33:38.000Z | ReClassMap.py | 70RMUND/ReclassMap | 5ecb13087b075441d2e2482cee4203a66bdba30e | [
"MIT"
] | null | null | null | ReClassMap.py | 70RMUND/ReclassMap | 5ecb13087b075441d2e2482cee4203a66bdba30e | [
"MIT"
] | 3 | 2018-10-06T13:06:26.000Z | 2018-10-17T13:57:59.000Z | # Copyright 2017 Tormund
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublic... | 31.736243 | 463 | 0.626966 |
from xml.etree.ElementTree import Element, SubElement, Comment, tostring
from xml.dom import minidom
import sys
class NodeType: nt_none = [-1 , 0 ] nt_base = [0 , 0 ] nt_instance = [1 , 8 ]
nt_struct = [2 , 0 ] nt_hidden = [3 , 0 ] nt_hex32 = [4 , 4 ]
nt_h... | false | true |
08f72eb69830bced3463186d6a914e82b2d0086d | 859 | py | Python | src/drod_bot/solve_room.py | AntonNeld/drodbot | b69f715392235dc0d90775c452276b6f12ec4776 | [
"MIT"
] | null | null | null | src/drod_bot/solve_room.py | AntonNeld/drodbot | b69f715392235dc0d90775c452276b6f12ec4776 | [
"MIT"
] | null | null | null | src/drod_bot/solve_room.py | AntonNeld/drodbot | b69f715392235dc0d90775c452276b6f12ec4776 | [
"MIT"
] | null | null | null | from room_simulator import (
ObjectiveReacher,
PlanningProblem,
SearcherDerivedRoomObjective,
FailureReason,
)
from search import NoSolutionError
from util import expand_planning_solution
def solve_room(room, objective):
"""Find a sequence of actions to solve a room.
Parameters
----------... | 27.709677 | 72 | 0.714785 | from room_simulator import (
ObjectiveReacher,
PlanningProblem,
SearcherDerivedRoomObjective,
FailureReason,
)
from search import NoSolutionError
from util import expand_planning_solution
def solve_room(room, objective):
objective_reacher = ObjectiveReacher(room)
problem = PlanningProblem(obje... | true | true |
08f73016e5f8b83961db74bc7b8eb164a3988d67 | 9,833 | py | Python | dynamo/models.py | gutard/django-dynamo | eef3c2ae1928eef8f50c4d9685316a6eb372ea3c | [
"BSD-3-Clause"
] | 4 | 2016-01-05T21:18:17.000Z | 2018-07-02T23:19:26.000Z | dynamo/models.py | gutard/django-dynamo | eef3c2ae1928eef8f50c4d9685316a6eb372ea3c | [
"BSD-3-Clause"
] | null | null | null | dynamo/models.py | gutard/django-dynamo | eef3c2ae1928eef8f50c4d9685316a6eb372ea3c | [
"BSD-3-Clause"
] | 3 | 2015-06-27T15:36:01.000Z | 2021-12-13T18:20:33.000Z |
# The follwong code was heavily inspired by and partly copied from
# https://github.com/willhardy/dynamic-models/blob/master/surveymaker/models.py
# and http://code.djangoproject.com/wiki/DynamicModels
# Django imports
from django.core.validators import ValidationError
from django.db import models, transaction, Int... | 38.560784 | 176 | 0.662361 |
from django.core.validators import ValidationError
from django.db import models, transaction, IntegrityError
from django.db.models.signals import post_save, pre_save, pre_delete, post_delete
from django.db.models.loading import cache as app_cache
from django.utils import simplejson
from django.utils.translation impor... | true | true |
08f7309ea2aae732b585e6caa7065589c298be55 | 128,150 | py | Python | torch/onnx/symbolic_opset9.py | guoyejun/pytorch | 57cba8e60116bfff37d10bc2b4596d8c478ffd0a | [
"Intel"
] | null | null | null | torch/onnx/symbolic_opset9.py | guoyejun/pytorch | 57cba8e60116bfff37d10bc2b4596d8c478ffd0a | [
"Intel"
] | 1 | 2021-04-12T19:49:08.000Z | 2021-04-12T19:49:08.000Z | torch/onnx/symbolic_opset9.py | shmsong/pytorch | 90e532f3ef17a9611e9e7a9f1f6189d4168bf084 | [
"Intel"
] | 1 | 2022-02-23T02:34:50.000Z | 2022-02-23T02:34:50.000Z | import torch
from torch._C import ListType, OptionalType
from torch.nn.modules.utils import _single, _pair, _triple
import torch.onnx
# This import monkey-patches graph manipulation methods on Graph, used for the
# ONNX symbolics
import torch.onnx.utils
from functools import partial
from functools import wraps
impor... | 41.851731 | 132 | 0.639969 | import torch
from torch._C import ListType, OptionalType
from torch.nn.modules.utils import _single, _pair, _triple
import torch.onnx
import torch.onnx.utils
from functools import partial
from functools import wraps
import torch.onnx.symbolic_helper as sym_help
from torch.onnx.symbolic_helper import parse_args, _par... | true | true |
08f7313d92491138ad13de9730dc967373bb2579 | 6,676 | py | Python | gestionaleimmobiliare/sync_agenzia/mapping/info_inserite.py | Zerrossetto/gi-sync-process | 5c7fd96ebd08e5d912a18a0d156422c6698d076f | [
"Apache-2.0"
] | null | null | null | gestionaleimmobiliare/sync_agenzia/mapping/info_inserite.py | Zerrossetto/gi-sync-process | 5c7fd96ebd08e5d912a18a0d156422c6698d076f | [
"Apache-2.0"
] | 2 | 2017-10-22T19:27:45.000Z | 2017-10-22T19:28:30.000Z | gestionaleimmobiliare/sync_agenzia/mapping/info_inserite.py | Zerrossetto/gi-sync-process | 5c7fd96ebd08e5d912a18a0d156422c6698d076f | [
"Apache-2.0"
] | null | null | null | import enum
from typing import Any
@enum.unique
class Tag(enum.Enum):
room = 1
sell_type = 2
furniture = 3
location = 4
@enum.unique
class EnergyLabel(enum.Enum):
da_definire = 0
A_plus_passiva = 1
A = 2
B = 3
C = 4
D = 5
E = 6
F = 7
G = 8
non_soggetto_certi... | 22.707483 | 59 | 0.592421 | import enum
from typing import Any
@enum.unique
class Tag(enum.Enum):
room = 1
sell_type = 2
furniture = 3
location = 4
@enum.unique
class EnergyLabel(enum.Enum):
da_definire = 0
A_plus_passiva = 1
A = 2
B = 3
C = 4
D = 5
E = 6
F = 7
G = 8
non_soggetto_certi... | true | true |
08f731807da046d355856828100849bac47746a1 | 238 | py | Python | aluraflix/serializers.py | bonetou/django-rest-tests-documentation | a9e640e6425da560215d8f985a428d8eb90e09f9 | [
"MIT"
] | null | null | null | aluraflix/serializers.py | bonetou/django-rest-tests-documentation | a9e640e6425da560215d8f985a428d8eb90e09f9 | [
"MIT"
] | null | null | null | aluraflix/serializers.py | bonetou/django-rest-tests-documentation | a9e640e6425da560215d8f985a428d8eb90e09f9 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from aluraflix.models import Programa
class ProgramaSerializer(serializers.ModelSerializer):
class Meta:
model = Programa
fields = ['titulo', 'tipo', 'data_lancamento', 'likes']
| 29.75 | 63 | 0.735294 | from rest_framework import serializers
from aluraflix.models import Programa
class ProgramaSerializer(serializers.ModelSerializer):
class Meta:
model = Programa
fields = ['titulo', 'tipo', 'data_lancamento', 'likes']
| true | true |
08f73252de07248fd85d99774a7f03ac36e4a002 | 9,423 | py | Python | fteikpy/bspline_model.py | pdales/FTeikPy | cc187d3beb658d02a7dfc1a78c7c54f507d525a2 | [
"MIT"
] | null | null | null | fteikpy/bspline_model.py | pdales/FTeikPy | cc187d3beb658d02a7dfc1a78c7c54f507d525a2 | [
"MIT"
] | null | null | null | fteikpy/bspline_model.py | pdales/FTeikPy | cc187d3beb658d02a7dfc1a78c7c54f507d525a2 | [
"MIT"
] | 1 | 2021-01-27T10:29:17.000Z | 2021-01-27T10:29:17.000Z | # -*- coding: utf-8 -*-
"""
Author: Keurfon Luu <keurfon.luu@mines-paristech.fr>
License: MIT
"""
import numpy as np
from scipy.interpolate import RegularGridInterpolator
from ._bspline import bspline as bspl
__all__ = [ "bspline1", "bspline2", "vel2spl", "spl2vel" ]
def bspline1(x, y, xq, order = 4, check = True)... | 40.969565 | 103 | 0.605646 |
import numpy as np
from scipy.interpolate import RegularGridInterpolator
from ._bspline import bspline as bspl
__all__ = [ "bspline1", "bspline2", "vel2spl", "spl2vel" ]
def bspline1(x, y, xq, order = 4, check = True):
if check:
if not isinstance(x, (np.ndarray, list)) and not np.asarray(x).ndim !=... | true | true |
08f73267694cf8be8d9cc6949d9295a62fe21c2e | 1,194 | py | Python | backend/conf/env.py | wuchaofan1654/tester | ff38d42e06cbdfa04882e8e95ada2dd93e6609f2 | [
"MIT"
] | null | null | null | backend/conf/env.py | wuchaofan1654/tester | ff38d42e06cbdfa04882e8e95ada2dd93e6609f2 | [
"MIT"
] | null | null | null | backend/conf/env.py | wuchaofan1654/tester | ff38d42e06cbdfa04882e8e95ada2dd93e6609f2 | [
"MIT"
] | null | null | null |
# ================================================= #
# ************** mysql数据库 配置 ************** #
# ================================================= #
# 数据库类型 MYSQL/SQLITE3
DATABASE_TYPE = "sqlite3"
# 数据库地址
DATABASE_HOST = "127.0.0.1"
# 数据库端口
DATABASE_PORT = 3306
# 数据库用户名
DATABASE_USER = "root"
# 数据库密码
DATABASE_P... | 23.88 | 74 | 0.476549 |
DATABASE_TYPE = "sqlite3"
DATABASE_HOST = "127.0.0.1"
DATABASE_PORT = 3306
DATABASE_USER = "root"
DATABASE_PASSWORD = "sandy@1654"
DATABASE_NAME = "automatic"
REDIS_ENABLE = True
REDIS_DB = 1
REDIS_HOST = '127.0.0.1'
REDIS_PORT = 6379
REDIS_PASSWORD = ''
CELERY_DB = 2
ALLOWED_HOSTS = ['*']
CORS_ORIGIN_ALLOW_ALL = T... | true | true |
08f7329748a91ef0b99edf97e9d7f5cf55ecd169 | 38,610 | py | Python | zcrmsdk/src/com/zoho/crm/api/blue_print/field.py | zoho/zohocrm-python-sdk-2.1 | cde6fcd1c5c8f7a572154ebb2b947ec697c24209 | [
"Apache-2.0"
] | null | null | null | zcrmsdk/src/com/zoho/crm/api/blue_print/field.py | zoho/zohocrm-python-sdk-2.1 | cde6fcd1c5c8f7a572154ebb2b947ec697c24209 | [
"Apache-2.0"
] | null | null | null | zcrmsdk/src/com/zoho/crm/api/blue_print/field.py | zoho/zohocrm-python-sdk-2.1 | cde6fcd1c5c8f7a572154ebb2b947ec697c24209 | [
"Apache-2.0"
] | null | null | null | try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
class Field(object):
def __init__(self):
"""Creates an instance of Field"""
self.__... | 24.990291 | 122 | 0.737995 | try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
class Field(object):
def __init__(self):
self.__system_mandatory = None
self.__webh... | true | true |
08f732fb30e0501113dba8ab33b4b896ac5b1a22 | 571 | py | Python | api/api/order/migrations/0003_ordermodel_product.py | anastasiyaSht/typography-shop | 7e4591b262e90fbffc8d9f6538585bf49df51aa6 | [
"MIT"
] | null | null | null | api/api/order/migrations/0003_ordermodel_product.py | anastasiyaSht/typography-shop | 7e4591b262e90fbffc8d9f6538585bf49df51aa6 | [
"MIT"
] | null | null | null | api/api/order/migrations/0003_ordermodel_product.py | anastasiyaSht/typography-shop | 7e4591b262e90fbffc8d9f6538585bf49df51aa6 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-11-04 19:26
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('product', '0004_auto_20201104_1922'),
('order', '0002_auto_20201104_1904'),
]
operations = [
migrat... | 25.954545 | 117 | 0.639229 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('product', '0004_auto_20201104_1922'),
('order', '0002_auto_20201104_1904'),
]
operations = [
migrations.AddField(
model_name='ordermode... | true | true |
08f733a4444477a316c734823ebca5d1ebfe5403 | 1,646 | py | Python | iTouch1G-VidConverter.py | TheMingus/iPodConvertCore | 9ecf55fe0a3331367143801c8016d7fc5ca892e5 | [
"MIT"
] | null | null | null | iTouch1G-VidConverter.py | TheMingus/iPodConvertCore | 9ecf55fe0a3331367143801c8016d7fc5ca892e5 | [
"MIT"
] | null | null | null | iTouch1G-VidConverter.py | TheMingus/iPodConvertCore | 9ecf55fe0a3331367143801c8016d7fc5ca892e5 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from urllib.request import urlcleanup
import ffmpy
import os
from yt_dlp import YoutubeDL
#-----=====@@@@@=====-----#
# Main menu
if not os.path.isdir(f'./iPod Videos'):
os.mkdir(f'./iPod Videos')
os.system('echo -n -e \"\033]0;iPod Video Converter\007\"')
os.system('clear'... | 38.27907 | 163 | 0.665249 | from __future__ import unicode_literals
from urllib.request import urlcleanup
import ffmpy
import os
from yt_dlp import YoutubeDL
if not os.path.isdir(f'./iPod Videos'):
os.mkdir(f'./iPod Videos')
os.system('echo -n -e \"\033]0;iPod Video Converter\007\"')
os.system('clear')
print(u'\u001b[1mWelcome to \u001b[35m... | true | true |
08f7353302473970f0480d1f0a2e13c1edb1ce02 | 497 | py | Python | plotly/validators/histogram/error_x/_symmetric.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/histogram/error_x/_symmetric.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/histogram/error_x/_symmetric.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class SymmetricValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name='symmetric',
parent_name='histogram.error_x',
**kwargs
):
super(SymmetricValidator, self).__init__(
plotly_name=plot... | 26.157895 | 72 | 0.61167 | import _plotly_utils.basevalidators
class SymmetricValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name='symmetric',
parent_name='histogram.error_x',
**kwargs
):
super(SymmetricValidator, self).__init__(
plotly_name=plot... | true | true |
08f73703652bd04525529d34a1c569bca3df14a7 | 9,907 | py | Python | glue/viewers/histogram/state.py | tiagopereira/glue | 85bf7ce2d252d7bc405e8160b56fc83d46b9cbe4 | [
"BSD-3-Clause"
] | 1 | 2019-12-17T07:58:35.000Z | 2019-12-17T07:58:35.000Z | glue/viewers/histogram/state.py | scalet98/glue | ff949ad52e205c20561f48c05f870b2abb39e0b0 | [
"BSD-3-Clause"
] | null | null | null | glue/viewers/histogram/state.py | scalet98/glue | ff949ad52e205c20561f48c05f870b2abb39e0b0 | [
"BSD-3-Clause"
] | 1 | 2019-08-04T14:10:12.000Z | 2019-08-04T14:10:12.000Z | from __future__ import absolute_import, division, print_function
import numpy as np
from glue.core import BaseData, Subset
from glue.external.echo import delay_callback
from glue.viewers.matplotlib.state import (MatplotlibDataViewerState,
MatplotlibLayerState,
... | 36.692593 | 97 | 0.587665 | from __future__ import absolute_import, division, print_function
import numpy as np
from glue.core import BaseData, Subset
from glue.external.echo import delay_callback
from glue.viewers.matplotlib.state import (MatplotlibDataViewerState,
MatplotlibLayerState,
... | true | true |
08f73806e0e64bdbf06173a52162c287bf2fa3d8 | 3,975 | py | Python | demo/demo.py | bird-house/birdhouse-workshop | 827ee97a216c08943a6af9a6d2e43ac09daeff3f | [
"Apache-2.0"
] | 1 | 2018-05-08T01:33:35.000Z | 2018-05-08T01:33:35.000Z | demo/demo.py | bird-house/birdhouse-workshop | 827ee97a216c08943a6af9a6d2e43ac09daeff3f | [
"Apache-2.0"
] | 1 | 2019-01-29T15:27:03.000Z | 2019-01-29T15:27:03.000Z | demo/demo.py | bird-house/birdhouse-workshop | 827ee97a216c08943a6af9a6d2e43ac09daeff3f | [
"Apache-2.0"
] | null | null | null | ###########################################################
# Demo WPS service for testing and debugging.
#
# See the werkzeug documentation on how to use the debugger:
# http://werkzeug.pocoo.org/docs/0.12/debug/
###########################################################
import os
from pywps.app.Service import Serv... | 31.547619 | 109 | 0.596478 |
import os
from pywps.app.Service import Service
from pywps import configuration
from pywps._compat import urlparse
import logging
logging.basicConfig(format='%(message)s', level=logging.INFO)
LOGGER = logging.getLogger('DEMO')
def create_app(cfgfiles=None):
import sys
pdir = os.path.abspath(os.path.curdir)... | true | true |
08f738db421aa7145fdd39b10525d68683b92374 | 7,326 | py | Python | Note-6 A3CNet/Note-6.4 HS300指数增强/sonnet/python/modules/rnn_core_test.py | summerRainn/DeepLearningNotes | 6657694d5e22e73969e47699b4e31a28385d0f19 | [
"MIT"
] | 345 | 2017-08-23T13:48:50.000Z | 2022-03-17T05:43:34.000Z | Note-6 A3CNet/Note-6.4 HS300指数增强/sonnet/python/modules/rnn_core_test.py | summerRainn/DeepLearningNotes | 6657694d5e22e73969e47699b4e31a28385d0f19 | [
"MIT"
] | 8 | 2017-09-30T15:01:23.000Z | 2019-12-18T08:46:08.000Z | Note-6 A3CNet/Note-6.4 HS300指数增强/sonnet/python/modules/rnn_core_test.py | summerRainn/DeepLearningNotes | 6657694d5e22e73969e47699b4e31a28385d0f19 | [
"MIT"
] | 224 | 2017-08-31T01:10:55.000Z | 2022-03-09T06:14:12.000Z | # Copyright 2017 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 39.176471 | 80 | 0.685231 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import mock
import numpy as np
import sonnet as snt
from sonnet.testing import parameterized
import tensorflow as tf
from tensorflow.python.util import nest
BATCH_SIZE = 5
MASK_TUPLE = (True, (False, True))... | true | true |
08f739d6606d5a5ff1761657a00e2672e3ca97ea | 8,766 | py | Python | tests/test_cfn_rsakey_provider.py | nasuni/cfn-secret-provider | c32609910ddc2ed7e7fd2994ba91f792b60ae56f | [
"Apache-2.0"
] | null | null | null | tests/test_cfn_rsakey_provider.py | nasuni/cfn-secret-provider | c32609910ddc2ed7e7fd2994ba91f792b60ae56f | [
"Apache-2.0"
] | 1 | 2019-03-17T16:06:24.000Z | 2019-03-17T16:06:24.000Z | tests/test_cfn_rsakey_provider.py | osgirl/cfn-secret-provider | 96153ed4a1219a0161aa64f50238742a5438cffd | [
"Apache-2.0"
] | 1 | 2019-03-07T09:36:10.000Z | 2019-03-07T09:36:10.000Z | import sys
import uuid
import hashlib
from cfn_rsakey_provider import RSAKeyProvider
from secrets import handler
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.hazmat.backends import default_backend
def test_defaults():
request = Request('Create', 'abc')
r = RS... | 37.144068 | 97 | 0.68104 | import sys
import uuid
import hashlib
from cfn_rsakey_provider import RSAKeyProvider
from secrets import handler
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.hazmat.backends import default_backend
def test_defaults():
request = Request('Create', 'abc')
r = RS... | true | true |
08f73a8677a5fd599c2f5e31a30ed8b31b89f431 | 1,102 | py | Python | odoons/commands/install.py | jiksaa/odoons | 6845b5cd1ad73a1d44f04772b63431c5a54cfca7 | [
"MIT"
] | null | null | null | odoons/commands/install.py | jiksaa/odoons | 6845b5cd1ad73a1d44f04772b63431c5a54cfca7 | [
"MIT"
] | 3 | 2021-10-05T14:29:51.000Z | 2021-10-17T21:52:41.000Z | odoons/commands/install.py | jiksaa/odoons | 6845b5cd1ad73a1d44f04772b63431c5a54cfca7 | [
"MIT"
] | null | null | null | import os
import subprocess
from .command import Command
from odoons.utils import printing
from odoons.utils.config import ADDONS_REQ_INSTALL_CONFIG, get_git_addons_path
class Install(Command):
def run(self, args):
"""
Action method responsible of the ACTION_INSTALL sub command
:return: ... | 33.393939 | 83 | 0.638838 | import os
import subprocess
from .command import Command
from odoons.utils import printing
from odoons.utils.config import ADDONS_REQ_INSTALL_CONFIG, get_git_addons_path
class Install(Command):
def run(self, args):
printing.info("Installing python dependencies...")
self.load_config(args.file)
... | true | true |
08f73af5149f08c9260b198da67c384d29423431 | 1,988 | py | Python | auth-api/src/auth_api/resources/bcol_profiles.py | shabeeb-aot/sbc-auth | a858cfdf8755560219d3e4c8531ebab82ceae923 | [
"Apache-2.0"
] | null | null | null | auth-api/src/auth_api/resources/bcol_profiles.py | shabeeb-aot/sbc-auth | a858cfdf8755560219d3e4c8531ebab82ceae923 | [
"Apache-2.0"
] | null | null | null | auth-api/src/auth_api/resources/bcol_profiles.py | shabeeb-aot/sbc-auth | a858cfdf8755560219d3e4c8531ebab82ceae923 | [
"Apache-2.0"
] | 1 | 2019-07-25T18:20:41.000Z | 2019-07-25T18:20:41.000Z | # Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 38.230769 | 108 | 0.740443 |
from flask import request
from flask_restplus import Namespace, Resource, cors
from auth_api.exceptions import BusinessException
from auth_api.auth import jwt as _jwt
from auth_api.utils.roles import Role
from auth_api.services.org import Org
from auth_api.tracer import Tracer
from auth_api.utils.util import cors_pre... | true | true |
08f73af80d1055f5c9f3228e250b385e7cccf774 | 7,283 | py | Python | src/tngsdksm/cli.py | tsoenen/tng-sdk-sm | 548dcb01d654db34f36e62913b40f112e7bcf7f1 | [
"Apache-2.0"
] | 1 | 2019-05-27T07:29:35.000Z | 2019-05-27T07:29:35.000Z | src/tngsdksm/cli.py | tsoenen/tng-sdk-sm | 548dcb01d654db34f36e62913b40f112e7bcf7f1 | [
"Apache-2.0"
] | 8 | 2018-11-20T13:01:26.000Z | 2019-08-23T12:13:15.000Z | src/tngsdksm/cli.py | tsoenen/tng-sdk-sm | 548dcb01d654db34f36e62913b40f112e7bcf7f1 | [
"Apache-2.0"
] | 1 | 2018-04-14T16:53:18.000Z | 2018-04-14T16:53:18.000Z | # Copyright (c) 2015 SONATA-NFV, 2017 5GTANGO
# 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 ... | 35.183575 | 81 | 0.550048 |
import sys
import argparse
import tngsdksm
import yaml
import os
import logging
LOG = logging.getLogger(__name__)
def run(args=None):
if args is None:
args = sys.argv[1:]
parsed_args = parse_args(args)
return dispatch(parsed_args)
def dispatch(args):
init_logger(args.verbose)
... | true | true |
08f73b10d983e883b611acea500db0d589447b0b | 7,484 | py | Python | appengine/cr-buildbucket/bulkproc.py | fknittel/git-retry-build | 4d57dd6e8b7567daeb24b55f66bc5becd3d459f3 | [
"BSD-3-Clause"
] | null | null | null | appengine/cr-buildbucket/bulkproc.py | fknittel/git-retry-build | 4d57dd6e8b7567daeb24b55f66bc5becd3d459f3 | [
"BSD-3-Clause"
] | 4 | 2022-03-17T18:58:21.000Z | 2022-03-17T18:58:22.000Z | appengine/cr-buildbucket/bulkproc.py | fknittel/git-retry-build | 4d57dd6e8b7567daeb24b55f66bc5becd3d459f3 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Build bulk processing of builds, a miniature map-reduce."""
import datetime
import json
import logging
import math
import posixpath
from google.appengin... | 29.936 | 80 | 0.646847 |
"""Build bulk processing of builds, a miniature map-reduce."""
import datetime
import json
import logging
import math
import posixpath
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
from components import utils
import webapp2
import model
QUEUE_NAME = 'bulkproc'
PATH_PREFIX = '/i... | false | true |
08f73cea183d2b65411f38f0c09dde749be59e90 | 170 | py | Python | sentiment-analytics/reddit-sentiments/reddit_keys.py | pradeep-charism/bigdata-analytics-ml | 7448cf61ba7b2c4be54f2d6b08f00b7641389633 | [
"MIT"
] | null | null | null | sentiment-analytics/reddit-sentiments/reddit_keys.py | pradeep-charism/bigdata-analytics-ml | 7448cf61ba7b2c4be54f2d6b08f00b7641389633 | [
"MIT"
] | null | null | null | sentiment-analytics/reddit-sentiments/reddit_keys.py | pradeep-charism/bigdata-analytics-ml | 7448cf61ba7b2c4be54f2d6b08f00b7641389633 | [
"MIT"
] | null | null | null | client_id = "mUDx28SwnElkOkkZP_fMYA" # your client id
client_secret = "vJ1g77oYII-EqJjuzAn7dz76DOzV8Q" # your client secret
user_agent = "Scraper 1.0 by /u/mtech-proj"
| 42.5 | 70 | 0.776471 | client_id = "mUDx28SwnElkOkkZP_fMYA" client_secret = "vJ1g77oYII-EqJjuzAn7dz76DOzV8Q" user_agent = "Scraper 1.0 by /u/mtech-proj"
| true | true |
08f73d1d21a9b090032c4f9a23741496c3481bac | 12,646 | py | Python | mmseg/apis/ote/apis/segmentation/config_utils.py | evgeniya-egupova/mmsegmentation | 3857f19321ad6af41c8a6af364898ee050225f4c | [
"Apache-2.0"
] | null | null | null | mmseg/apis/ote/apis/segmentation/config_utils.py | evgeniya-egupova/mmsegmentation | 3857f19321ad6af41c8a6af364898ee050225f4c | [
"Apache-2.0"
] | null | null | null | mmseg/apis/ote/apis/segmentation/config_utils.py | evgeniya-egupova/mmsegmentation | 3857f19321ad6af41c8a6af364898ee050225f4c | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 36.443804 | 109 | 0.688834 |
import copy
import glob
import logging
import os
import tempfile
from collections import defaultdict
from typing import List, Optional
from mmcv import Config, ConfigDict
from ote_sdk.entities.datasets import DatasetEntity
from ote_sdk.entities.label import LabelEntity
from ote_sdk.usecases.reporting.time_monitor_ca... | true | true |
08f73eafcf5bf2a5fc357daa73e43de1b60bb267 | 101 | py | Python | naima/tests/setup_package.py | Carlor87/naima | 1728b0ac18fab9e709816c868625e5ffbaab83b7 | [
"BSD-3-Clause"
] | 32 | 2015-01-02T03:09:58.000Z | 2022-03-04T15:30:53.000Z | src/naima/tests/setup_package.py | renlliang3/naima | 41a27cd44566aa8797fd44260431a554fcd8baff | [
"BSD-3-Clause"
] | 97 | 2015-01-28T20:09:44.000Z | 2021-11-01T23:16:12.000Z | src/naima/tests/setup_package.py | renlliang3/naima | 41a27cd44566aa8797fd44260431a554fcd8baff | [
"BSD-3-Clause"
] | 45 | 2015-01-16T09:17:15.000Z | 2022-03-31T08:33:46.000Z | def get_package_data():
return {_ASTROPY_PACKAGE_NAME_ + ".tests": ["coveragerc", "data/*.dat"]}
| 33.666667 | 76 | 0.683168 | def get_package_data():
return {_ASTROPY_PACKAGE_NAME_ + ".tests": ["coveragerc", "data/*.dat"]}
| true | true |
08f73fb8f163211fe1a1096eae4c3bf55984c727 | 8,719 | py | Python | src/vae_filter.py | EsauPR/3d-pose-baseline | 2f521fe3008ddee81b666550606f7405efd2f547 | [
"MIT"
] | null | null | null | src/vae_filter.py | EsauPR/3d-pose-baseline | 2f521fe3008ddee81b666550606f7405efd2f547 | [
"MIT"
] | null | null | null | src/vae_filter.py | EsauPR/3d-pose-baseline | 2f521fe3008ddee81b666550606f7405efd2f547 | [
"MIT"
] | null | null | null | """ Train a VAE model used to filter and enhance 3d points """
import json
import time
from datetime import datetime
import matplotlib
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import data_utils
import viz
from top_vae_3d_pose import data_handle... | 36.028926 | 140 | 0.64629 |
import json
import time
from datetime import datetime
import matplotlib
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import data_utils
import viz
from top_vae_3d_pose import data_handler, losses, models
from top_vae_3d_pose.args_def import ENVIRON ... | true | true |
08f740a2ebee097bcaa7b3fb8066c0105960c200 | 1,190 | py | Python | src/core/migrations/0133_auto_20191223_2031.py | metabolism-of-cities/ARCHIVED-metabolism-of-cities-platform-v3 | c754d3b1b401906a21640b8eacb6b724a448b31c | [
"MIT"
] | null | null | null | src/core/migrations/0133_auto_20191223_2031.py | metabolism-of-cities/ARCHIVED-metabolism-of-cities-platform-v3 | c754d3b1b401906a21640b8eacb6b724a448b31c | [
"MIT"
] | null | null | null | src/core/migrations/0133_auto_20191223_2031.py | metabolism-of-cities/ARCHIVED-metabolism-of-cities-platform-v3 | c754d3b1b401906a21640b8eacb6b724a448b31c | [
"MIT"
] | null | null | null | # Generated by Django 2.2.7 on 2019-12-23 20:31
from django.db import migrations
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('core', '0132_auto_20191223_2030'),
]
operations = [
migrations.AlterModelOptions(
name='methodcategory',
... | 29.02439 | 96 | 0.589076 |
from django.db import migrations
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('core', '0132_auto_20191223_2030'),
]
operations = [
migrations.AlterModelOptions(
name='methodcategory',
options={'verbose_name': 'method family', 've... | true | true |
08f742b0ce61bbcbc7450d09f850cc966182e62a | 9,007 | py | Python | subcommand.py | fanbojie/depot_tools | 355e97e300e8baceae8353287ad59b915dbb8196 | [
"BSD-3-Clause"
] | 1 | 2019-08-17T04:07:01.000Z | 2019-08-17T04:07:01.000Z | subcommand.py | fanbojie/depot_tools | 355e97e300e8baceae8353287ad59b915dbb8196 | [
"BSD-3-Clause"
] | 1 | 2022-03-02T09:56:27.000Z | 2022-03-02T09:56:27.000Z | subcommand.py | fanbojie/depot_tools | 355e97e300e8baceae8353287ad59b915dbb8196 | [
"BSD-3-Clause"
] | 1 | 2020-03-07T16:07:25.000Z | 2020-03-07T16:07:25.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Manages subcommands in a script.
Each subcommand should look like this:
@usage('[pet name]')
def CMDpet(parser, args):
'''Prints a pet.
Many... | 34.377863 | 80 | 0.658266 |
import difflib
import sys
import textwrap
def usage(more):
def hook(fn):
fn.usage_more = more
return fn
return hook
def epilog(text):
def hook(fn):
fn.epilog = text
return fn
return hook
def CMDhelp(parser, args):
if not any(i in ('-h', '--help') for i in args):
args = args + [... | true | true |
08f742bfb615122572ba21c9de46f59de166169e | 1,967 | py | Python | trimesh/comparison.py | als11044/trimesh | a29735c47cf6a473ba77fdf8be0d3f6fd104c9fc | [
"MIT"
] | null | null | null | trimesh/comparison.py | als11044/trimesh | a29735c47cf6a473ba77fdf8be0d3f6fd104c9fc | [
"MIT"
] | null | null | null | trimesh/comparison.py | als11044/trimesh | a29735c47cf6a473ba77fdf8be0d3f6fd104c9fc | [
"MIT"
] | null | null | null | import numpy as np
from . import util
from .constants import tol
# how many signifigant figures to use for each field of the identifier
identifier_sigfig = (5, # mesh volume, pretty stable
3, # mesh area
1, # ratio of original mesh volume to convex hull volume
... | 26.581081 | 78 | 0.581596 | import numpy as np
from . import util
from .constants import tol
identifier_sigfig = (5, 3, 1, 6, 2)
def identifier_simple(mesh):
identifier = np.array([mesh.volume,
mesh.area,
... | true | true |
08f74348c78badcdbedb533f953e2f199efbe2f4 | 448 | py | Python | Story/tasks.py | RAPTOR-XR/Meety-Version_2.0 | c93e108995c8ffd687b2475c8fd9f9d93dbafcfb | [
"MIT"
] | null | null | null | Story/tasks.py | RAPTOR-XR/Meety-Version_2.0 | c93e108995c8ffd687b2475c8fd9f9d93dbafcfb | [
"MIT"
] | null | null | null | Story/tasks.py | RAPTOR-XR/Meety-Version_2.0 | c93e108995c8ffd687b2475c8fd9f9d93dbafcfb | [
"MIT"
] | null | null | null | from celery import shared_task
from Story.models import Story, StoryStream
from datetime import datetime, timedelta
@shared_task
def CheckStoriesDate():
exp_date = datetime.now() - timedelta(hours=1)
old_stories = Story.objects.filter(posted__lt=exp_date)
old_stories.update(expired=True)
print("Stories updated")
... | 28 | 56 | 0.799107 | from celery import shared_task
from Story.models import Story, StoryStream
from datetime import datetime, timedelta
@shared_task
def CheckStoriesDate():
exp_date = datetime.now() - timedelta(hours=1)
old_stories = Story.objects.filter(posted__lt=exp_date)
old_stories.update(expired=True)
print("Stories updated")
... | true | true |
08f7435bad96a284532274c54219317e6377c4e6 | 464 | py | Python | modules/vtk_basic/vtkPNMWriter.py | chrisidefix/devide | 99bfe156e710fa47ba7ae88b0ce1eef592a3a439 | [
"BSD-3-Clause"
] | 25 | 2015-08-24T16:05:14.000Z | 2020-12-09T20:07:14.000Z | modules/vtk_basic/vtkPNMWriter.py | chrisidefix/devide | 99bfe156e710fa47ba7ae88b0ce1eef592a3a439 | [
"BSD-3-Clause"
] | 1 | 2016-02-16T21:18:10.000Z | 2016-02-16T21:18:10.000Z | modules/vtk_basic/vtkPNMWriter.py | chrisidefix/devide | 99bfe156e710fa47ba7ae88b0ce1eef592a3a439 | [
"BSD-3-Clause"
] | 5 | 2016-02-16T20:05:37.000Z | 2020-01-31T11:27:39.000Z | # class generated by DeVIDE::createDeVIDEModuleFromVTKObject
from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase
import vtk
class vtkPNMWriter(SimpleVTKClassModuleBase):
def __init__(self, module_manager):
SimpleVTKClassModuleBase.__init__(
self, module_manager,
vtk.vtkP... | 35.692308 | 63 | 0.700431 | from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase
import vtk
class vtkPNMWriter(SimpleVTKClassModuleBase):
def __init__(self, module_manager):
SimpleVTKClassModuleBase.__init__(
self, module_manager,
vtk.vtkPNMWriter(), 'Writing vtkPNM.',
('vtkPNM',), (),
... | true | true |
08f7438fed86f7a5a0ecd5c6596931d146886e48 | 2,268 | py | Python | corefacility/core/test/views/synchronization_test/synchronization_client.py | serik1987/corefacility | 78d84e19403361e83ef562e738473849f9133bef | [
"RSA-MD"
] | null | null | null | corefacility/core/test/views/synchronization_test/synchronization_client.py | serik1987/corefacility | 78d84e19403361e83ef562e738473849f9133bef | [
"RSA-MD"
] | null | null | null | corefacility/core/test/views/synchronization_test/synchronization_client.py | serik1987/corefacility | 78d84e19403361e83ef562e738473849f9133bef | [
"RSA-MD"
] | null | null | null | from time import sleep
from rest_framework import status
class SynchronizationClient:
"""
Provides the sychronization routines for testing purposes given that
accounts are completely different
"""
MAX_REQUESTS = 200
SLEEP_TIME = 1.0
client = None
test_module = None
headers = None... | 33.850746 | 118 | 0.641975 | from time import sleep
from rest_framework import status
class SynchronizationClient:
MAX_REQUESTS = 200
SLEEP_TIME = 1.0
client = None
test_module = None
headers = None
method = None
_details = None
def __init__(self, client, test_module, headers):
self.client = client
... | true | true |
08f743a6d5823c9e4bce65eb16bc4b52793b8017 | 1,888 | py | Python | dizoo/atari/config/serial/spaceinvaders/spaceinvaders_a2c_config.py | LuciusMos/DI-engine | b040b1c36afce038effec9eb483f625131573824 | [
"Apache-2.0"
] | 464 | 2021-07-08T07:26:33.000Z | 2022-03-31T12:35:16.000Z | dizoo/atari/config/serial/spaceinvaders/spaceinvaders_a2c_config.py | LuciusMos/DI-engine | b040b1c36afce038effec9eb483f625131573824 | [
"Apache-2.0"
] | 177 | 2021-07-09T08:22:55.000Z | 2022-03-31T07:35:22.000Z | dizoo/atari/config/serial/spaceinvaders/spaceinvaders_a2c_config.py | LuciusMos/DI-engine | b040b1c36afce038effec9eb483f625131573824 | [
"Apache-2.0"
] | 92 | 2021-07-08T12:16:37.000Z | 2022-03-31T09:24:41.000Z | from copy import deepcopy
from ding.entry import serial_pipeline
from easydict import EasyDict
space_invaders_a2c_config = dict(
env=dict(
collector_env_num=16,
evaluator_env_num=8,
n_evaluator_episode=8,
stop_value=10000000000,
env_id='SpaceInvadersNoFrameskip-v4',
... | 31.466667 | 105 | 0.60911 | from copy import deepcopy
from ding.entry import serial_pipeline
from easydict import EasyDict
space_invaders_a2c_config = dict(
env=dict(
collector_env_num=16,
evaluator_env_num=8,
n_evaluator_episode=8,
stop_value=10000000000,
env_id='SpaceInvadersNoFrameskip-v4',
... | true | true |
08f7452f91737ccea888796c9f0016990ce6c4a5 | 41 | py | Python | pylie/__init__.py | Ostoic/pylie | d568fda94ce4b0e249fcf9ffad83860aed5771a5 | [
"MIT"
] | null | null | null | pylie/__init__.py | Ostoic/pylie | d568fda94ce4b0e249fcf9ffad83860aed5771a5 | [
"MIT"
] | null | null | null | pylie/__init__.py | Ostoic/pylie | d568fda94ce4b0e249fcf9ffad83860aed5771a5 | [
"MIT"
] | null | null | null | import sl2
from constant import constants | 20.5 | 30 | 0.878049 | import sl2
from constant import constants | true | true |
08f746d87610bc5caca7c8bdb4fd4333e968fefa | 5,364 | py | Python | idaes/core/base/tests/test_process_base.py | aladshaw3/idaes-pse | 23d627958cfd934e91fc6cfc2c82661c67237bb5 | [
"RSA-MD"
] | null | null | null | idaes/core/base/tests/test_process_base.py | aladshaw3/idaes-pse | 23d627958cfd934e91fc6cfc2c82661c67237bb5 | [
"RSA-MD"
] | null | null | null | idaes/core/base/tests/test_process_base.py | aladshaw3/idaes-pse | 23d627958cfd934e91fc6cfc2c82661c67237bb5 | [
"RSA-MD"
] | null | null | null | #################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | 28.83871 | 84 | 0.509508 | import pytest
from io import StringIO
import types
import pandas
from pyomo.environ import Block, ConcreteModel, Set, Var, Param, Expression, units
from idaes.core.base.process_base import ProcessBaseBlock
from idaes.core import FlowsheetBlockData, declare_process_block_class
@declare_process_block_class("Flowsheet... | true | true |
08f747a770ce1d84f572a0f1bb7291ad5f2d7da2 | 7,389 | py | Python | src/isle/memoize.py | chelseajohn/isle | f610b55a1e8b6d2584896eb649092b0524cc1f8c | [
"MIT"
] | 2 | 2021-01-14T17:47:01.000Z | 2021-07-16T22:31:25.000Z | src/isle/memoize.py | chelseajohn/isle | f610b55a1e8b6d2584896eb649092b0524cc1f8c | [
"MIT"
] | 21 | 2018-06-04T07:09:02.000Z | 2020-12-11T09:37:08.000Z | src/isle/memoize.py | chelseajohn/isle | f610b55a1e8b6d2584896eb649092b0524cc1f8c | [
"MIT"
] | 3 | 2021-01-18T19:18:29.000Z | 2021-03-26T03:27:15.000Z | r"""!\file
\brief Utilities for memoizing function results.
Memoization decorators let us compute expensive functions once and store the result,
so that if the function is called again with the same arguments the result is just returned.
"""
import functools
import inspect
import typing
import weakref
from dataclass... | 35.185714 | 111 | 0.62796 |
import functools
import inspect
import typing
import weakref
from dataclasses import dataclass
from logging import getLogger
class MemoizeMethod:
@dataclass
class MemoizedData:
argvals: typing.Any
result: typin... | true | true |
08f747ffcc6db0d68ac5d224453bd719b2eef975 | 4,372 | py | Python | pyconde/sponsorship/migrations/0001_initial.py | EuroPython/djep | afcccbdda483e5f6962ac97f0dc4c4c5ea67fd21 | [
"BSD-3-Clause"
] | 5 | 2015-01-02T14:33:14.000Z | 2021-08-03T10:19:07.000Z | pyconde/sponsorship/migrations/0001_initial.py | EuroPython/djep | afcccbdda483e5f6962ac97f0dc4c4c5ea67fd21 | [
"BSD-3-Clause"
] | null | null | null | pyconde/sponsorship/migrations/0001_initial.py | EuroPython/djep | afcccbdda483e5f6962ac97f0dc4c4c5ea67fd21 | [
"BSD-3-Clause"
] | 3 | 2015-08-30T09:45:03.000Z | 2017-04-08T12:15:22.000Z | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'SponsorLevel'
db.create_table('sponsorship_sponsorlevel', (
('id', self.gf('dj... | 55.341772 | 117 | 0.593321 | 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.create_table('sponsorship_sponsorlevel', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=Tr... | true | true |
08f748cd8113930c5c947297e541a8c880072644 | 10,249 | py | Python | integrateyolo.py | iamalex5156/Vehicle-Indicator-Toolset | cfc46f408cf3cc04a4f0c0f8841189b9dc8ffc2c | [
"MIT"
] | 13 | 2021-03-22T15:37:29.000Z | 2021-11-02T08:20:57.000Z | integrateyolo.py | iamalex5156/Vehicle-Indicator-Toolset | cfc46f408cf3cc04a4f0c0f8841189b9dc8ffc2c | [
"MIT"
] | null | null | null | integrateyolo.py | iamalex5156/Vehicle-Indicator-Toolset | cfc46f408cf3cc04a4f0c0f8841189b9dc8ffc2c | [
"MIT"
] | 3 | 2021-03-23T06:24:24.000Z | 2021-03-24T09:52:29.000Z | import numpy as np
import cv2
import imutils
import time
from sklearn.metrics import pairwise
from imutils.video import FPS
import copy
import os
import sys
import tensorflow as tf
import pathlib
from collections import defaultdict
from utils import tracking_utils
from utils import signalDetection_utils
from utils i... | 29.116477 | 177 | 0.611669 | import numpy as np
import cv2
import imutils
import time
from sklearn.metrics import pairwise
from imutils.video import FPS
import copy
import os
import sys
import tensorflow as tf
import pathlib
from collections import defaultdict
from utils import tracking_utils
from utils import signalDetection_utils
from utils i... | true | true |
08f7499ae89e5dfecd5c6e1049c2bc2d0c0d3901 | 347 | py | Python | lightly/api/routes/users/docker/__init__.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | 1 | 2021-06-23T07:31:26.000Z | 2021-06-23T07:31:26.000Z | lightly/api/routes/users/docker/__init__.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | null | null | null | lightly/api/routes/users/docker/__init__.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | null | null | null | """ Docker Routes
This site is under construction.
"""
# Copyright (c) 2020. Lightly AG and its affiliates.
# All Rights Reserved
from lightly.api.routes.users.docker.service import get_authorization
from lightly.api.routes.users.docker.service import get_soft_authorization
from lightly.api.routes.users.docker.servi... | 28.916667 | 74 | 0.81268 |
from lightly.api.routes.users.docker.service import get_authorization
from lightly.api.routes.users.docker.service import get_soft_authorization
from lightly.api.routes.users.docker.service import post_diagnostics
| true | true |
08f74a28eb07819b4490926e11a5ea7c2694cdc3 | 328 | py | Python | src/lander/__init__.py | lsst-sqre/lander | 1e8a3e29869cffc451c5fcef874cdbf663bd7965 | [
"MIT"
] | 2 | 2019-05-10T16:56:30.000Z | 2021-12-13T20:28:59.000Z | src/lander/__init__.py | lsst-sqre/lander | 1e8a3e29869cffc451c5fcef874cdbf663bd7965 | [
"MIT"
] | 4 | 2019-07-16T14:41:53.000Z | 2021-02-08T00:59:45.000Z | src/lander/__init__.py | lsst-sqre/lander | 1e8a3e29869cffc451c5fcef874cdbf663bd7965 | [
"MIT"
] | null | null | null | """HTML landing page generator for LSST PDF documentation deployed from Git to
LSST the Docs.
https://github.com/lsst-sqre/lander
"""
from pkg_resources import DistributionNotFound, get_distribution
try:
__version__ = get_distribution("lander").version
except DistributionNotFound:
# package is not installed
... | 25.230769 | 78 | 0.780488 | from pkg_resources import DistributionNotFound, get_distribution
try:
__version__ = get_distribution("lander").version
except DistributionNotFound:
pass
| true | true |
08f74b0130b01e7d42835887963c1c2998a64da1 | 3,217 | py | Python | maskrcnn_benchmark/modeling/backbone/efficientdet_backbone.py | anslt/efficientdet_mask | 7ee75894a3f3c6428484e85b41f1ffedd657f128 | [
"MIT"
] | 1 | 2020-06-15T09:59:46.000Z | 2020-06-15T09:59:46.000Z | maskrcnn_benchmark/modeling/backbone/efficientdet_backbone.py | anslt/efficientdet_mask | 7ee75894a3f3c6428484e85b41f1ffedd657f128 | [
"MIT"
] | null | null | null | maskrcnn_benchmark/modeling/backbone/efficientdet_backbone.py | anslt/efficientdet_mask | 7ee75894a3f3c6428484e85b41f1ffedd657f128 | [
"MIT"
] | null | null | null | # Author: Zylo117
import math
import torch
from torch import nn
from .efficientdet import BiFPN, Regressor, Classifier, EfficientNet
# from .efficientdet.utils import Anchors
class EfficientDetBackbone(nn.Module):
def __init__(self, cfg, **kwargs):
super(EfficientDetBackbone, self).__init__()
c... | 37.847059 | 195 | 0.601181 |
import math
import torch
from torch import nn
from .efficientdet import BiFPN, Regressor, Classifier, EfficientNet
class EfficientDetBackbone(nn.Module):
def __init__(self, cfg, **kwargs):
super(EfficientDetBackbone, self).__init__()
compound_coef = cfg.EFFICIENTNET.COEF
load_weights = ... | true | true |
08f74b3bdab5b9868f39ead133abbdf2082114ba | 6,085 | py | Python | training_data_flow_from_directory.py | blakete/Wearable-Data-Analysis | 05fa449db482f28adccb22b7a423099d84ba253a | [
"MIT"
] | null | null | null | training_data_flow_from_directory.py | blakete/Wearable-Data-Analysis | 05fa449db482f28adccb22b7a423099d84ba253a | [
"MIT"
] | null | null | null | training_data_flow_from_directory.py | blakete/Wearable-Data-Analysis | 05fa449db482f28adccb22b7a423099d84ba253a | [
"MIT"
] | null | null | null | # Author: Blake Edwards
import os
import re
import sys
import math
import numpy as np
import pandas as pd
from sys import exit
from glob import glob
from dateutil import parser
from datetime import datetime
if len(sys.argv) != 2:
print("[INCORRECT USAGE] try $ python3 /path/to/downloaded/dataset>")
exit()
col... | 45.75188 | 230 | 0.631389 | import os
import re
import sys
import math
import numpy as np
import pandas as pd
from sys import exit
from glob import glob
from dateutil import parser
from datetime import datetime
if len(sys.argv) != 2:
print("[INCORRECT USAGE] try $ python3 /path/to/downloaded/dataset>")
exit()
collected_data_path = sys.a... | true | true |
08f74b4883fc61221587db1a748c18fc9de0a18d | 1,276 | py | Python | pedantic/tests/validate/test_validator_max.py | LostInDarkMath/Pedantic-python-decorators | 32ed54c9593e80f63c0499093cb07847d8a5e1df | [
"Apache-2.0"
] | null | null | null | pedantic/tests/validate/test_validator_max.py | LostInDarkMath/Pedantic-python-decorators | 32ed54c9593e80f63c0499093cb07847d8a5e1df | [
"Apache-2.0"
] | null | null | null | pedantic/tests/validate/test_validator_max.py | LostInDarkMath/Pedantic-python-decorators | 32ed54c9593e80f63c0499093cb07847d8a5e1df | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
from pedantic.decorators.fn_deco_validate.exceptions import ParameterException
from pedantic.decorators.fn_deco_validate.fn_deco_validate import validate
from pedantic.decorators.fn_deco_validate.parameters import Parameter
from pedantic.decorators.fn_deco_validate.validators.max import M... | 34.486486 | 83 | 0.710815 | from unittest import TestCase
from pedantic.decorators.fn_deco_validate.exceptions import ParameterException
from pedantic.decorators.fn_deco_validate.fn_deco_validate import validate
from pedantic.decorators.fn_deco_validate.parameters import Parameter
from pedantic.decorators.fn_deco_validate.validators.max import M... | true | true |
08f74bd797864540ba8f0f75431567f0f3e765e1 | 1,979 | py | Python | sampling_helper.py | mcfrank/dmww | cdacac49c4574f6d1cd48c4c8a4914432c26d9fb | [
"MIT"
] | null | null | null | sampling_helper.py | mcfrank/dmww | cdacac49c4574f6d1cd48c4c8a4914432c26d9fb | [
"MIT"
] | null | null | null | sampling_helper.py | mcfrank/dmww | cdacac49c4574f6d1cd48c4c8a4914432c26d9fb | [
"MIT"
] | null | null | null | import numpy as np
from random import *
from scipy.special import gammaln
from scipy import stats
########################################################################
## PROPOSAL DISTRIBUTIONS FOR HYPERPARAMETER INFERENCE
# proposal function for variables that can't go below zero
def alter_0inf_var(ob):
nb = ... | 23.843373 | 72 | 0.543204 | import numpy as np
from random import *
from scipy.special import gammaln
from scipy import stats
def alter_0inf_var(ob):
nb = ob
if random() > .5:
nb = ob + np.exp(gauss(0, 2))
else:
nb = ob - np.exp(gauss(0, 2))
# can't go below zero
if nb < 0:
nb = ob
return nb
d... | true | true |
08f74c172cf55d4eeef7092fa041bb456cf05d3f | 8,725 | py | Python | tppss/cli.py | gvellut/tppss | 849b615a023a50a648c33423f3709f9af57f4feb | [
"MIT"
] | null | null | null | tppss/cli.py | gvellut/tppss | 849b615a023a50a648c33423f3709f9af57f4feb | [
"MIT"
] | null | null | null | tppss/cli.py | gvellut/tppss | 849b615a023a50a648c33423f3709f9af57f4feb | [
"MIT"
] | null | null | null | from datetime import datetime
import logging
import sys
import traceback
import click
import colorama
from colorama import Fore, Style
from dateutil import tz as dutz
import rasterio
from . import horizon, KM, sunrise_sunset, sunrise_sunset_details, sunrise_sunset_year
colorama.init()
logger = logging.getLogger(__p... | 25.661765 | 88 | 0.605845 | from datetime import datetime
import logging
import sys
import traceback
import click
import colorama
from colorama import Fore, Style
from dateutil import tz as dutz
import rasterio
from . import horizon, KM, sunrise_sunset, sunrise_sunset_details, sunrise_sunset_year
colorama.init()
logger = logging.getLogger(__p... | true | true |
08f74c58e2ee60c1effe3d10a5f996ea3bf1e822 | 8,212 | py | Python | tests/integration/catalogue/test_attributes.py | pwalsh/django-oscar | 23013a61a1f84517522c071bbeddb3fd3e841ee6 | [
"BSD-3-Clause"
] | 2 | 2022-03-10T03:43:55.000Z | 2022-03-10T03:45:58.000Z | tests/integration/catalogue/test_attributes.py | pwalsh/django-oscar | 23013a61a1f84517522c071bbeddb3fd3e841ee6 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/catalogue/test_attributes.py | pwalsh/django-oscar | 23013a61a1f84517522c071bbeddb3fd3e841ee6 | [
"BSD-3-Clause"
] | null | null | null | from datetime import date, datetime
from django.core.exceptions import ValidationError
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase
from oscar.apps.catalogue.models import Product, ProductAttribute, ProductClass
from oscar.test import factories
class TestContainer(T... | 35.860262 | 111 | 0.698977 | from datetime import date, datetime
from django.core.exceptions import ValidationError
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase
from oscar.apps.catalogue.models import Product, ProductAttribute, ProductClass
from oscar.test import factories
class TestContainer(T... | true | true |
08f74d00efb23a504fd76aa1871db184dfefa53b | 1,086 | py | Python | update/update_neuro_papers.py | wowdd1/xlinkbook | f3de5a80c296c35e3012c3a1184b452d6fac1fd6 | [
"MIT"
] | 27 | 2016-07-11T21:16:41.000Z | 2021-07-23T23:10:42.000Z | update/update_neuro_papers.py | honorpeter/xlinkBook | e6646603b06eb5ffa9d8e5f4980599b183fe427a | [
"MIT"
] | 1 | 2017-06-29T09:24:51.000Z | 2018-04-29T02:28:39.000Z | update/update_neuro_papers.py | honorpeter/xlinkBook | e6646603b06eb5ffa9d8e5f4980599b183fe427a | [
"MIT"
] | 18 | 2016-10-21T08:19:51.000Z | 2020-11-04T05:09:11.000Z | #!/usr/bin/env python
# ACS Chem Neurosci
# Anal Chem
# Annu Rev Genomics Hum Genet
# Appl Opt
# Biol Psychiatry
# Biophys J
# BMC Bioinformatics
# Brain
# Cell
# Cell Rep
# Cell Stem Cell
# Cell Syst
# Curr Biol
# Curr Opin Chem Biol
# Curr Opin Neurobiol
# Curr Opin Pharmacol
# Curr Protoc Neurosci
# Elife
# Front H... | 15.73913 | 34 | 0.72744 | true | true | |
08f74ebb187b183a78291c43ce856f3db300e655 | 317 | py | Python | Python/08. Date and Time/002. Time Delta.py | Snehakri022/HackerrankPractice | 15c2da0bfb4bce744b345c4a3613ae9a769f2676 | [
"MIT"
] | 831 | 2018-05-12T19:06:09.000Z | 2022-03-31T19:33:54.000Z | Python/08. Date and Time/002. Time Delta.py | Snehakri022/HackerrankPractice | 15c2da0bfb4bce744b345c4a3613ae9a769f2676 | [
"MIT"
] | 2 | 2019-06-17T14:58:56.000Z | 2021-03-05T23:49:59.000Z | Python/08. Date and Time/002. Time Delta.py | Snehakri022/HackerrankPractice | 15c2da0bfb4bce744b345c4a3613ae9a769f2676 | [
"MIT"
] | 457 | 2018-06-11T07:01:57.000Z | 2022-03-28T11:08:34.000Z | # Problem: https://www.hackerrank.com/challenges/python-time-delta/problem
# Score: 30
from datetime import datetime as dt
fmt = '%a %d %b %Y %H:%M:%S %z'
for _ in range(int(input())):
time1 = dt.strptime(input(), fmt)
time2 = dt.strptime(input(), fmt)
print(int(abs((time1 - time2).total_seconds())))
| 26.416667 | 74 | 0.652997 |
from datetime import datetime as dt
fmt = '%a %d %b %Y %H:%M:%S %z'
for _ in range(int(input())):
time1 = dt.strptime(input(), fmt)
time2 = dt.strptime(input(), fmt)
print(int(abs((time1 - time2).total_seconds())))
| true | true |
08f7509485401280cf21790ced7f2764cf48fbce | 16,190 | py | Python | src/Components/missions/TEMPO/clouds/make_lg1_tempo_cld.py | GEOS-ESM/AeroApps | 874dad6f34420c014d98eccbe81a061bdc0110cf | [
"NASA-1.3",
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-12-02T14:23:30.000Z | 2021-12-31T15:39:30.000Z | src/Components/missions/TEMPO/clouds/make_lg1_tempo_cld.py | GEOS-ESM/AeroApps | 874dad6f34420c014d98eccbe81a061bdc0110cf | [
"NASA-1.3",
"ECL-2.0",
"Apache-2.0"
] | 9 | 2020-04-15T16:22:14.000Z | 2022-03-24T13:59:25.000Z | src/Components/missions/TEMPO/clouds/make_lg1_tempo_cld.py | GEOS-ESM/AeroApps | 874dad6f34420c014d98eccbe81a061bdc0110cf | [
"NASA-1.3",
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Make the lg1 file for the TEMPO cloud sub-grid
"""
import numpy as np
from numpy import radians, degrees
from math import radians, cos, sin, asin, sqrt, tan, atan
from netCDF4 import Dataset
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from matplotlib import cm, col... | 31.31528 | 330 | 0.642001 | """
Make the lg1 file for the TEMPO cloud sub-grid
"""
import numpy as np
from numpy import radians, degrees
from math import radians, cos, sin, asin, sqrt, tan, atan
from netCDF4 import Dataset
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from matplotlib import cm, colors
from geopy import ... | false | true |
08f7512660d28abec2abfcd55b652f206f515614 | 5,659 | py | Python | kw/platform/utils.py | kiwicom/kiwi-platform-py | 15a6c3f41680b941834e1142429ac12de9131a06 | [
"BlueOak-1.0.0"
] | 2 | 2019-08-06T09:39:48.000Z | 2019-10-10T08:23:59.000Z | kw/platform/utils.py | kiwicom/kiwi-platform-py | 15a6c3f41680b941834e1142429ac12de9131a06 | [
"BlueOak-1.0.0"
] | 36 | 2019-05-30T06:46:17.000Z | 2020-01-10T09:43:14.000Z | kw/platform/utils.py | kiwicom/kiwi-platform-py | 15a6c3f41680b941834e1142429ac12de9131a06 | [
"BlueOak-1.0.0"
] | 1 | 2021-02-16T07:56:17.000Z | 2021-02-16T07:56:17.000Z | """
Utils
=====
"""
import importlib
import logging
import os
import re
from datetime import datetime
from dateutil.parser import parse
from . import settings
from ._compat import ModuleNotFoundError # pylint: disable=redefined-builtin
try:
import sentry_sdk
sentry_sdk_enabled = True
except ImportError:
... | 30.424731 | 87 | 0.640749 |
import importlib
import logging
import os
import re
from datetime import datetime
from dateutil.parser import parse
from . import settings
from ._compat import ModuleNotFoundError
try:
import sentry_sdk
sentry_sdk_enabled = True
except ImportError:
sentry_sdk_enabled = False
USER_AGENT_RE = re.comp... | true | true |
08f751cda88e998ac315162691d042c1a2415794 | 747 | py | Python | python/200problems/conditionandloop/fibonacci.py | imjoseangel/100DaysOfCode | bff90569033e2b02a56e893bd45727125962aeb3 | [
"MIT"
] | 1 | 2022-03-30T12:59:44.000Z | 2022-03-30T12:59:44.000Z | python/200problems/conditionandloop/fibonacci.py | imjoseangel/100DaysOfCode | bff90569033e2b02a56e893bd45727125962aeb3 | [
"MIT"
] | null | null | null | python/200problems/conditionandloop/fibonacci.py | imjoseangel/100DaysOfCode | bff90569033e2b02a56e893bd45727125962aeb3 | [
"MIT"
] | 3 | 2019-08-13T11:33:36.000Z | 2022-03-08T22:00:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
unicode_literals, annotations)
# Write a Python program to get the Fibonacci series between 0 to 50
import matplotlib.pyplot as plt
def fibonacciinput(maxnumber):
fibonacci =... | 21.342857 | 68 | 0.663989 |
from __future__ import (division, absolute_import, print_function,
unicode_literals, annotations)
import matplotlib.pyplot as plt
def fibonacciinput(maxnumber):
fibonacci = []
minnumber = 0
sumnumber = 1
while sumnumber <= maxnumber:
fibonacci.append(sumnumber)
... | true | true |
08f752aed310c21340f15c0565c0cbd8144f686a | 3,342 | py | Python | accounts_example/settings.py | kasper190/accounts_example | 8548c19d955c2609a7cf78d84986250592bb52bc | [
"MIT"
] | null | null | null | accounts_example/settings.py | kasper190/accounts_example | 8548c19d955c2609a7cf78d84986250592bb52bc | [
"MIT"
] | null | null | null | accounts_example/settings.py | kasper190/accounts_example | 8548c19d955c2609a7cf78d84986250592bb52bc | [
"MIT"
] | null | null | null | from datetime import timedelta
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = ')v==rz!p#s$dcwhhbhvn6bt)@9692vl9iqz3bq-z$83djc)x&_'
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttype... | 24.755556 | 91 | 0.695392 | from datetime import timedelta
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = ')v==rz!p#s$dcwhhbhvn6bt)@9692vl9iqz3bq-z$83djc)x&_'
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttype... | true | true |
08f752d7d97167098c383d7e28974ab53e97f4bb | 22,066 | py | Python | lib/galaxy_test/api/test_libraries.py | biomarble/galaxy | 5767dbe975e1ce51fec70541d4b89c55609d45ee | [
"CC-BY-3.0"
] | 1 | 2020-03-11T15:17:32.000Z | 2020-03-11T15:17:32.000Z | lib/galaxy_test/api/test_libraries.py | biomarble/galaxy | 5767dbe975e1ce51fec70541d4b89c55609d45ee | [
"CC-BY-3.0"
] | 72 | 2019-06-06T18:52:41.000Z | 2022-02-17T02:53:18.000Z | lib/galaxy_test/api/test_libraries.py | biomarble/galaxy | 5767dbe975e1ce51fec70541d4b89c55609d45ee | [
"CC-BY-3.0"
] | 1 | 2022-03-01T08:07:54.000Z | 2022-03-01T08:07:54.000Z | import json
import time
import unittest
from galaxy_test.base.populators import (
DatasetCollectionPopulator,
DatasetPopulator,
LibraryPopulator,
TestsDatasets,
)
from ._framework import ApiTestCase
FILE_URL = 'https://raw.githubusercontent.com/galaxyproject/galaxy/dev/test-data/4.bed'
FILE_MD5 = "37b... | 50.264237 | 158 | 0.664824 | import json
import time
import unittest
from galaxy_test.base.populators import (
DatasetCollectionPopulator,
DatasetPopulator,
LibraryPopulator,
TestsDatasets,
)
from ._framework import ApiTestCase
FILE_URL = 'https://raw.githubusercontent.com/galaxyproject/galaxy/dev/test-data/4.bed'
FILE_MD5 = "37b... | true | true |
08f753934071ac4abb5a2a363cd7c93d7b2bace1 | 1,480 | py | Python | creme/meta/pred_clipper.py | Leo-VK/creme | 0b02df4f4c826368747ee91946efca1a7e8653a6 | [
"BSD-3-Clause"
] | 23 | 2020-11-21T22:09:24.000Z | 2022-03-21T22:33:07.000Z | creme/meta/pred_clipper.py | 53X/creme | 3b397d6aafdfad48dbb36813c90ed3fd1844fc30 | [
"BSD-3-Clause"
] | null | null | null | creme/meta/pred_clipper.py | 53X/creme | 3b397d6aafdfad48dbb36813c90ed3fd1844fc30 | [
"BSD-3-Clause"
] | 1 | 2021-04-25T16:24:43.000Z | 2021-04-25T16:24:43.000Z | from creme import base
from creme import utils
__all__ = ['PredClipper']
class PredClipper(base.Regressor, base.WrapperMixin):
"""Clips the target after predicting.
Parameters:
regressor: regressor model applied for training.
y_min: minimum value.
y_max: maximum value.
Example:... | 23.125 | 78 | 0.529054 | from creme import base
from creme import utils
__all__ = ['PredClipper']
class PredClipper(base.Regressor, base.WrapperMixin):
def __init__(self, regressor: base.Regressor, y_min: float, y_max: float):
self.regressor = regressor
self.y_min = y_min
self.y_max = y_max
@property
d... | true | true |
08f754ffa5bbacda79621c9a92045b64901d6836 | 630 | py | Python | battlechips/urls.py | ArchAether/chip-library | 10321d8cf241f90e75215711cbd674c46567d7b1 | [
"MIT"
] | null | null | null | battlechips/urls.py | ArchAether/chip-library | 10321d8cf241f90e75215711cbd674c46567d7b1 | [
"MIT"
] | null | null | null | battlechips/urls.py | ArchAether/chip-library | 10321d8cf241f90e75215711cbd674c46567d7b1 | [
"MIT"
] | null | null | null | from os import name
from django.urls import path
from . import views
urlpatterns = [
path('<int:id_number>/', views.mmbn6_by_id, name='by_id'),
path('<str:name>/', views.mmbn_by_name, name='by_name'),
path('elem/<str:elem>/', views.mmbn6_by_elem, name="by_elem"),
path('desc/<str:description>/', views.... | 42 | 86 | 0.680952 | from os import name
from django.urls import path
from . import views
urlpatterns = [
path('<int:id_number>/', views.mmbn6_by_id, name='by_id'),
path('<str:name>/', views.mmbn_by_name, name='by_name'),
path('elem/<str:elem>/', views.mmbn6_by_elem, name="by_elem"),
path('desc/<str:description>/', views.... | true | true |
08f7565271d20250e66985309afa6b81109847dc | 2,392 | py | Python | framework/modelhubapi_tests/mockmodels/contrib_src_si/inference.py | modelhub-ai/modelhub-engine | 81e893fb7669ee9912178346efbf828dd8c0410b | [
"MIT"
] | 6 | 2018-10-13T10:11:51.000Z | 2022-02-21T08:28:10.000Z | framework/modelhubapi_tests/mockmodels/contrib_src_si/inference.py | modelhub-ai/modelhub-docker | 81e893fb7669ee9912178346efbf828dd8c0410b | [
"MIT"
] | 34 | 2018-03-06T16:25:10.000Z | 2018-06-26T21:55:13.000Z | framework/modelhubapi_tests/mockmodels/contrib_src_si/inference.py | modelhub-ai/modelhub-engine | 81e893fb7669ee9912178346efbf828dd8c0410b | [
"MIT"
] | 3 | 2019-08-15T18:09:32.000Z | 2022-02-16T07:55:27.000Z | """
Implementation of several mock models to test the API. Each model has a
slightly different behaviour, which should be properly handled by the API.
Also most models are not fully valid, e.g. they do not comply to the mock
config. This is ok for unit testing, most models are only used for a small
set of specific test... | 29.530864 | 80 | 0.642559 |
import os
import numpy as np
from modelhublib.model import ModelBase
class Model(ModelBase):
def __init__(self):
pass
def infer(self, input):
if os.path.isfile(input):
label_list = [{"label": "class_0", 'probability': 0.3},
{"label": "class_... | true | true |
08f757281f158ed1c520fdd1ca25ef5599a721f9 | 43,671 | py | Python | src/azure-cli/azure/cli/command_modules/appconfig/_kv_helpers.py | jyothirmaikatighar/azure-cli | 1bd397971e8c26d685a612889ca1b663fa8c9cdb | [
"MIT"
] | 4 | 2016-08-23T06:19:01.000Z | 2018-03-20T22:47:15.000Z | src/azure-cli/azure/cli/command_modules/appconfig/_kv_helpers.py | jyothirmaikatighar/azure-cli | 1bd397971e8c26d685a612889ca1b663fa8c9cdb | [
"MIT"
] | 120 | 2018-03-27T19:14:40.000Z | 2020-12-10T23:53:35.000Z | src/azure-cli/azure/cli/command_modules/appconfig/_kv_helpers.py | jyothirmaikatighar/azure-cli | 1bd397971e8c26d685a612889ca1b663fa8c9cdb | [
"MIT"
] | 11 | 2018-08-23T21:31:06.000Z | 2020-09-03T21:39:51.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 43.714715 | 187 | 0.600536 |
import io
import json
import re
import chardet
import javaproperties
import yaml
from jsondiff import JsonDiffer
from knack.log import get_logger
from knack.util import CLIError
from azure.appconfiguration import ResourceReadOnlyError
from azure.core.exceptions import HttpResponseError
from ._constants import (Feat... | true | true |
08f7591459ad45029cd6189a233811e4abed392a | 782 | py | Python | setup.py | NewStore-oss/json-encoder | 0c680ab2d457bc35f186ab38a23e8628dd9b8380 | [
"MIT"
] | null | null | null | setup.py | NewStore-oss/json-encoder | 0c680ab2d457bc35f186ab38a23e8628dd9b8380 | [
"MIT"
] | null | null | null | setup.py | NewStore-oss/json-encoder | 0c680ab2d457bc35f186ab38a23e8628dd9b8380 | [
"MIT"
] | 1 | 2019-12-05T10:08:45.000Z | 2019-12-05T10:08:45.000Z | import os
from setuptools import setup
VERSION = "1.0.4"
NAMESPACE = "newstore"
NAME = "{}.json_encoder".format(NAMESPACE)
def local_text_file(file_name):
path = os.path.join(os.path.dirname(__file__), file_name)
with open(path, "rt") as fp:
file_data = fp.read()
return file_data
setup(
na... | 23.69697 | 61 | 0.681586 | import os
from setuptools import setup
VERSION = "1.0.4"
NAMESPACE = "newstore"
NAME = "{}.json_encoder".format(NAMESPACE)
def local_text_file(file_name):
path = os.path.join(os.path.dirname(__file__), file_name)
with open(path, "rt") as fp:
file_data = fp.read()
return file_data
setup(
na... | true | true |
08f75a87f4887111703182b2c6dec451da37ec7c | 1,609 | py | Python | main.py | fjk-softdev/PortOpti | 1323c4685fed7a725a46030f8900308904f57b84 | [
"MIT"
] | null | null | null | main.py | fjk-softdev/PortOpti | 1323c4685fed7a725a46030f8900308904f57b84 | [
"MIT"
] | null | null | null | main.py | fjk-softdev/PortOpti | 1323c4685fed7a725a46030f8900308904f57b84 | [
"MIT"
] | null | null | null | '''
Created on 11.10.2017
@author: Felix
'''
from pandas_datareader import data
from pandas import DataFrame, read_csv
import pandas as pd
import matplotlib.pyplot as plt
import Security as Security
import Portfolio as Portfolio
# -------------------------------
startDate = '01/01/2013'
endDate ... | 30.942308 | 92 | 0.760721 | from pandas_datareader import data
from pandas import DataFrame, read_csv
import pandas as pd
import matplotlib.pyplot as plt
import Security as Security
import Portfolio as Portfolio
startDate = '01/01/2013'
endDate = '10/13/2017'
EuropeSmallCapETF = Security.Security('EuropeSmallCap','SXRJ.DE','MS... | true | true |
08f75b448ad2d9e407e12364c62e5ce3fec4e6a9 | 12,218 | py | Python | scripts/test_rdiv_topology_generalization.py | kouroshHakha/circuit-fewshot-code | 32007e119da30632736868a3f643027624bf08d2 | [
"BSD-3-Clause"
] | null | null | null | scripts/test_rdiv_topology_generalization.py | kouroshHakha/circuit-fewshot-code | 32007e119da30632736868a3f643027624bf08d2 | [
"BSD-3-Clause"
] | null | null | null | scripts/test_rdiv_topology_generalization.py | kouroshHakha/circuit-fewshot-code | 32007e119da30632736868a3f643027624bf08d2 | [
"BSD-3-Clause"
] | null | null | null |
# load the config file and the model
# load weights on to the model
# run validation error checker
# run test on new topology
# create new topology graphs (locally first and then in another repo)
# Note: methodologically generate diverse topologies for rdiv
from collections import defaultdict
from pathlib import... | 47.913725 | 153 | 0.596088 |
from collections import defaultdict
from pathlib import Path
import argparse
import imp
import numpy as np
from pprint import pprint
import matplotlib.pyplot as plt
from tqdm import tqdm
import torch
from torch_geometric.data import DataLoader
from torch_geometric.utils import to_networkx
import pytorch_lightn... | true | true |
08f75cf1fb24157ee10866775804d26ac02acd2e | 2,539 | py | Python | spyder/plugins/completion/providers/snippets/trie.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 7,956 | 2015-02-17T01:19:09.000Z | 2022-03-31T21:52:15.000Z | spyder/plugins/completion/providers/snippets/trie.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 16,326 | 2015-02-16T23:15:21.000Z | 2022-03-31T23:34:34.000Z | spyder/plugins/completion/providers/snippets/trie.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 1,918 | 2015-02-20T19:26:26.000Z | 2022-03-31T19:03:25.000Z | # -*- coding: utf-8 -*-
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""General purpose prefix tree, also known as a trie."""
class TrieNode:
def __init__(self, key=None, value=None):
self.children = {}
self.key = ... | 26.726316 | 62 | 0.510437 |
class TrieNode:
def __init__(self, key=None, value=None):
self.children = {}
self.key = key
self.value = value
def __setitem__(self, sequence, value):
elem = sequence[0]
if self.key is None:
self.key = elem
if len(self.key) > 0:
seque... | true | true |
08f75d16af0120c0758cc9b85bd73d760a1bc6e8 | 11,398 | py | Python | spectrometer.py | cncoleal/Outreach | bcf9cc3d0cf1189dcc95562b595be90e1884203b | [
"MIT"
] | null | null | null | spectrometer.py | cncoleal/Outreach | bcf9cc3d0cf1189dcc95562b595be90e1884203b | [
"MIT"
] | null | null | null | spectrometer.py | cncoleal/Outreach | bcf9cc3d0cf1189dcc95562b595be90e1884203b | [
"MIT"
] | null | null | null | import sys
import math
import time
import picamera
from fractions import Fraction
from collections import OrderedDict
from PIL import Image, ImageDraw, ImageFile, ImageFont
# NTS: ORIGINAL FILE DO NOT EDIT
# scan a column to determine top and bottom of area of lightness
def get_spectrum_y_bound(pix, x, middle_y, sp... | 33.133721 | 127 | 0.601246 | import sys
import math
import time
import picamera
from fractions import Fraction
from collections import OrderedDict
from PIL import Image, ImageDraw, ImageFile, ImageFont
def get_spectrum_y_bound(pix, x, middle_y, spectrum_threshold, spectrum_threshold_duration):
c = 0
spectrum_top = middle_y
for y in ... | true | true |
08f75d4837763be2361f6d62aaa8e6a57104660d | 3,787 | py | Python | apero/science/preprocessing/general.py | njcuk9999/apero-drs | 83b043e9f277a011b03e0227c77307961b200901 | [
"MIT"
] | 1 | 2021-03-09T17:49:31.000Z | 2021-03-09T17:49:31.000Z | apero/science/preprocessing/general.py | njcuk9999/apero-drs | 83b043e9f277a011b03e0227c77307961b200901 | [
"MIT"
] | 43 | 2020-10-06T18:42:24.000Z | 2022-03-28T21:23:10.000Z | apero/science/preprocessing/general.py | njcuk9999/apero-drs | 83b043e9f277a011b03e0227c77307961b200901 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2019-12-12 at 09:45
@author: cook
"""
import numpy as np
from apero.core import constants
from apero.core import math as mp
from apero import core
from apero import lang
# ========================================... | 35.064815 | 79 | 0.505941 | import numpy as np
from apero.core import constants
from apero.core import math as mp
from apero import core
from apero import lang
__NAME__ = 'preprocessing.general.py'
__INSTRUMENT__ = 'None'
Constants = constants.load(__INSTRUMENT__)
__version__ = Constants['DRS_VERSION']
__author__ = Constants['AUTHORS']
__date_... | true | true |
08f75df62c4ec358e0ebaa5a382f7ad139e5d717 | 32,836 | py | Python | src/processors/processor.py | shmilee/gdpy3 | 2e007851fc87793c0038f7b1dacba729271e17a3 | [
"MIT"
] | 4 | 2018-08-07T13:28:06.000Z | 2021-03-08T04:31:20.000Z | src/processors/processor.py | shmilee/gdpy3 | 2e007851fc87793c0038f7b1dacba729271e17a3 | [
"MIT"
] | null | null | null | src/processors/processor.py | shmilee/gdpy3 | 2e007851fc87793c0038f7b1dacba729271e17a3 | [
"MIT"
] | 3 | 2018-05-05T01:34:33.000Z | 2022-03-07T15:57:10.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018-2021 shmilee
'''
Contains processor base class.
'''
import os
import re
import time
import pickle
import hashlib
from .. import __gversion__
from ..glogger import getGLogger
from ..loaders import is_rawloader, get_rawloader, is_pckloader, get_pckloader
from ..savers impo... | 38.813239 | 85 | 0.56167 |
import os
import re
import time
import pickle
import hashlib
from .. import __gversion__
from ..glogger import getGLogger
from ..loaders import is_rawloader, get_rawloader, is_pckloader, get_pckloader
from ..savers import is_pcksaver, get_pcksaver
from ..cores.exporter import Exporter
from ..visplters import get_vi... | true | true |
08f75f45e370fa43a75b9adb3ab1e26cd85ac274 | 12,101 | py | Python | lingvo/core/tokenizers.py | HubBucket-Team/lingvo | fb929def2f27cf73a6ee1b1eaa8bee982bd92987 | [
"Apache-2.0"
] | 1 | 2019-10-10T06:08:35.000Z | 2019-10-10T06:08:35.000Z | lingvo/core/tokenizers.py | VonRosenchild/lingvo | fb929def2f27cf73a6ee1b1eaa8bee982bd92987 | [
"Apache-2.0"
] | null | null | null | lingvo/core/tokenizers.py | VonRosenchild/lingvo | fb929def2f27cf73a6ee1b1eaa8bee982bd92987 | [
"Apache-2.0"
] | 1 | 2019-10-10T06:08:39.000Z | 2019-10-10T06:08:39.000Z | # Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | 35.279883 | 80 | 0.67168 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import lingvo.compat as tf
from lingvo.core import base_layer
from lingvo.core import ops
from lingvo.core import py_utils
from lingvo.core import wpm_encoder
import numpy as np
class BaseTokenizer(base_laye... | true | true |
08f75f5d8ee8d6afbcf9b038e4f8dcf0237a5b56 | 5,800 | py | Python | slim/nas/eval_nas.py | LielinJiang/PaddleSeg | 7c4d39da3d0ff635cac066aeb61e23dfada5d0d7 | [
"Apache-2.0"
] | null | null | null | slim/nas/eval_nas.py | LielinJiang/PaddleSeg | 7c4d39da3d0ff635cac066aeb61e23dfada5d0d7 | [
"Apache-2.0"
] | null | null | null | slim/nas/eval_nas.py | LielinJiang/PaddleSeg | 7c4d39da3d0ff635cac066aeb61e23dfada5d0d7 | [
"Apache-2.0"
] | null | null | null | # coding: utf8
# copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# 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 requ... | 31.182796 | 90 | 0.662241 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
os.environ['FLAGS_eager_delete_tensor_gb'] = "0.0"
import sys
LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
SEG_PATH = os.path.join(LOCAL_PATH, "../../", "pdseg")
sys.path.append(SEG_PATH... | true | true |
08f75f6245e963599fde891da63e022066d1220f | 12,230 | py | Python | tests/pay_to_test.py | mflaxman/pycoin | 7ad692afa9fabd0b1b0c6f1cf989771243e27b86 | [
"MIT"
] | 2 | 2019-08-20T03:13:25.000Z | 2020-03-15T02:09:21.000Z | tests/pay_to_test.py | mflaxman/pycoin | 7ad692afa9fabd0b1b0c6f1cf989771243e27b86 | [
"MIT"
] | null | null | null | tests/pay_to_test.py | mflaxman/pycoin | 7ad692afa9fabd0b1b0c6f1cf989771243e27b86 | [
"MIT"
] | 3 | 2020-09-04T16:31:50.000Z | 2021-06-21T08:52:26.000Z | #!/usr/bin/env python
import io
import copy
import unittest
from pycoin.key import Key
from pycoin.serialize import h2b
from pycoin.scripts.tx import DEFAULT_VERSION
from pycoin.tx import Tx, TxIn, TxOut, SIGHASH_ALL, tx_utils
from pycoin.tx.TxOut import standard_tx_out_script
from pycoin.tx.Spendable import Spendable... | 62.717949 | 897 | 0.722486 |
import io
import copy
import unittest
from pycoin.key import Key
from pycoin.serialize import h2b
from pycoin.scripts.tx import DEFAULT_VERSION
from pycoin.tx import Tx, TxIn, TxOut, SIGHASH_ALL, tx_utils
from pycoin.tx.TxOut import standard_tx_out_script
from pycoin.tx.Spendable import Spendable
from pycoin.tx.tx_uti... | true | true |
08f75f8df7a566d035724094c12207c5cc772dc7 | 1,272 | py | Python | src/books/management/commands/add_book_data.py | lukecyx/lms | eff57c4026e63cd7dd7ea5ac1f061fa0a9ec1a4c | [
"MIT"
] | null | null | null | src/books/management/commands/add_book_data.py | lukecyx/lms | eff57c4026e63cd7dd7ea5ac1f061fa0a9ec1a4c | [
"MIT"
] | null | null | null | src/books/management/commands/add_book_data.py | lukecyx/lms | eff57c4026e63cd7dd7ea5ac1f061fa0a9ec1a4c | [
"MIT"
] | null | null | null | import itertools
from typing import TypedDict
from src.books.management.commands._private import SharedBookCommand
from src.books.models import Book
from src.helpers.commands.csv_import import transform
class BookRecord(TypedDict):
"""Represents a record in books.csv."""
goodreads_book_id: int
books_cou... | 24.941176 | 75 | 0.653302 | import itertools
from typing import TypedDict
from src.books.management.commands._private import SharedBookCommand
from src.books.models import Book
from src.helpers.commands.csv_import import transform
class BookRecord(TypedDict):
goodreads_book_id: int
books_count: int
isbn: str
isbn13: str
au... | true | true |
08f75f9442c9d8ffabf8ca988fcb8c99479f14a2 | 13,570 | py | Python | env/lib/python3.8/site-packages/plotly/validators/_isosurface.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2 | 2021-07-07T20:16:23.000Z | 2021-07-14T14:03:09.000Z | env/lib/python3.8/site-packages/plotly/validators/_isosurface.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 5 | 2020-06-05T20:56:21.000Z | 2021-09-22T19:12:42.000Z | env/lib/python3.8/site-packages/plotly/validators/_isosurface.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2 | 2020-07-05T12:57:14.000Z | 2020-07-05T12:58:00.000Z | import _plotly_utils.basevalidators
class IsosurfaceValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="isosurface", parent_name="", **kwargs):
super(IsosurfaceValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 47.78169 | 75 | 0.543699 | import _plotly_utils.basevalidators
class IsosurfaceValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="isosurface", parent_name="", **kwargs):
super(IsosurfaceValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
08f75ffe3c02ca8e809c9367425499bacef60463 | 1,823 | py | Python | ssh-test.py | 802Tophat/ssh-checker | b68cb62dc10bbad8e798bdd78900527223be0999 | [
"Unlicense"
] | 1 | 2019-06-07T02:02:09.000Z | 2019-06-07T02:02:09.000Z | ssh-test.py | 802Tophat/ssh-checker | b68cb62dc10bbad8e798bdd78900527223be0999 | [
"Unlicense"
] | null | null | null | ssh-test.py | 802Tophat/ssh-checker | b68cb62dc10bbad8e798bdd78900527223be0999 | [
"Unlicense"
] | null | null | null | from __future__ import absolute_import, division, print_function
from netmiko import ConnectHandler
from getpass import getpass
import os
import signal
import sys
#signal.signal(signal.SIGPIPE, signal.SIG_DFL) # IOError: Broken pipe
#signal.signal(signal.SIGINT, signal.SIG_DFL) # KeyboardInterrupt: Ctrl-C
... | 29.403226 | 77 | 0.611629 | from __future__ import absolute_import, division, print_function
from netmiko import ConnectHandler
from getpass import getpass
import os
import signal
import sys
def get_input(prompt=''):
try:
line = raw_input(prompt)
except NameError:
line = input(prompt)
return line
de... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.