hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1aa33202eee6049d8c4e3bfa4eeecaf8607c7623 | 1,442 | py | Python | 07_chart_types/bar_chart_3d.py | r00c/automating_excel_with_python | b4fa01aa6bdc2ec1c87a3e9cd00813b100f81f8b | [
"MIT"
] | 43 | 2021-07-01T11:50:38.000Z | 2022-03-26T13:56:15.000Z | 07_chart_types/bar_chart_3d.py | wenxuefeng3930/automating_excel_with_python | dc2509359e1b14d2ad694f9fe554f3ce1781e497 | [
"MIT"
] | 1 | 2021-11-06T23:06:21.000Z | 2021-11-07T01:24:44.000Z | 07_chart_types/bar_chart_3d.py | wenxuefeng3930/automating_excel_with_python | dc2509359e1b14d2ad694f9fe554f3ce1781e497 | [
"MIT"
] | 11 | 2021-06-25T02:06:35.000Z | 2022-03-31T14:29:59.000Z | # bar_chart_3d.py
from openpyxl import Workbook
from openpyxl.chart import BarChart3D, Reference
def create_excel_data(sheet):
data_rows = [
["", "Kindle", "Paperback"],
["Python 101", 9.99, 25.99],
["Python 201: Intermediate Python", 9.99, 25.99],
["wxPython Cookbook", 9.99, 25.9... | 28.27451 | 66 | 0.60957 |
1aa33c6253687db596a912f8415ccf986104724a | 4,534 | py | Python | datawinners/project/submission_form.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | 1 | 2015-11-02T09:11:12.000Z | 2015-11-02T09:11:12.000Z | datawinners/project/submission_form.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | datawinners/project/submission_form.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | from django.forms import CharField, HiddenInput, ChoiceField, Select
from django.forms.forms import Form
from django.utils.translation import ugettext_lazy as _, gettext
from mangrove.form_model.field import UniqueIdField
from datawinners.project.questionnaire_fields import FormField, as_choices
from datawinners.proje... | 48.234043 | 154 | 0.644464 |
1aa34f42fccc33616ec3120700b7f9bcaeb2e9f3 | 1,260 | py | Python | superset/migrations/versions/1296d28ec131_druid_exports.py | rodrigoguariento/incubator-superset | b2633a51d43faaca74751349b96fc32784d4b377 | [
"Apache-2.0"
] | 18,621 | 2017-06-19T09:57:44.000Z | 2021-01-05T06:28:21.000Z | superset/migrations/versions/1296d28ec131_druid_exports.py | Odirlei-Stein/incubator-superset | 52afc33b31475536b287b56d262b9eaa32f479ab | [
"Apache-2.0"
] | 9,043 | 2017-07-05T16:10:48.000Z | 2021-01-05T17:58:01.000Z | superset/migrations/versions/1296d28ec131_druid_exports.py | Odirlei-Stein/incubator-superset | 52afc33b31475536b287b56d262b9eaa32f479ab | [
"Apache-2.0"
] | 5,527 | 2017-07-06T01:39:43.000Z | 2021-01-05T06:01:11.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 30.731707 | 81 | 0.752381 |
1aa37a7f82ca36cdea0b29942b7f5c53edfcfe2b | 3,945 | py | Python | pylowdb/adapters.py | Ho011/pylowdb | 1922358aca6db3e529deb321ad4fc8435fd3eaef | [
"MIT"
] | 3 | 2021-12-30T08:43:33.000Z | 2022-01-26T20:59:09.000Z | pylowdb/adapters.py | Ho011/pylowdb | 1922358aca6db3e529deb321ad4fc8435fd3eaef | [
"MIT"
] | null | null | null | pylowdb/adapters.py | Ho011/pylowdb | 1922358aca6db3e529deb321ad4fc8435fd3eaef | [
"MIT"
] | null | null | null | from typing import (
TypeVar,
Union,
)
from abc import ABC, abstractmethod
import os
from os import path
import json
try:
import yaml
except ImportError as e:
print('yaml is not installed, please install it with pip install PyYAML')
except Exception:
print('Error cannot import yaml')
__all__ = [
... | 23.343195 | 80 | 0.572624 |
1aa3b128c0a581d9a9b430bde048dd36812c15f0 | 334 | py | Python | python/python_notes/decorators/demo4.py | zhaoace/codecraft | bf06267e86bd7386714911b0df4aa0ca0a91d882 | [
"Unlicense"
] | null | null | null | python/python_notes/decorators/demo4.py | zhaoace/codecraft | bf06267e86bd7386714911b0df4aa0ca0a91d882 | [
"Unlicense"
] | null | null | null | python/python_notes/decorators/demo4.py | zhaoace/codecraft | bf06267e86bd7386714911b0df4aa0ca0a91d882 | [
"Unlicense"
] | null | null | null | def compose_greet_func():
def get_message():
return "Hello there!"
return get_message
greet = compose_greet_func()
print greet()
# Outputs: Hello there!
def get_a_message_function():
def get_message():
return "hi message!"
return get_message
message = get_a_message_function()
pr... | 14.521739 | 34 | 0.688623 |
1aa3dd35bb229d8f795367b209cb92b41df3a1f6 | 7,774 | py | Python | utils/extract_datasets.py | lzamparo/SdA_reduce | 1dc11f23b395f316df5f41448542d2d5c2e619ff | [
"BSD-3-Clause"
] | null | null | null | utils/extract_datasets.py | lzamparo/SdA_reduce | 1dc11f23b395f316df5f41448542d2d5c2e619ff | [
"BSD-3-Clause"
] | null | null | null | utils/extract_datasets.py | lzamparo/SdA_reduce | 1dc11f23b395f316df5f41448542d2d5c2e619ff | [
"BSD-3-Clause"
] | null | null | null | """ Utilities for data set extraction and scaling """
from tables import *
import numpy as np
def draw_reference_population(data_set_file,proportion=0.06,root='/plates',ignore_fewer_than=50):
""" Walk the tree of plates/<plate>/<well>, drawing a proportionate sample from each well """
# do I have to decl... | 40.701571 | 157 | 0.648444 |
1aa42a13c0d2be23a153d25d1439af5b7cbfd723 | 638 | py | Python | torchreid/losses/__init__.py | Arindam-1991/deep_reid | ab68d95c2229ef5b832a6a6b614a9b91e4984bd5 | [
"MIT"
] | 1 | 2021-03-27T17:27:47.000Z | 2021-03-27T17:27:47.000Z | torchreid/losses/__init__.py | Arindam-1991/deep_reid | ab68d95c2229ef5b832a6a6b614a9b91e4984bd5 | [
"MIT"
] | null | null | null | torchreid/losses/__init__.py | Arindam-1991/deep_reid | ab68d95c2229ef5b832a6a6b614a9b91e4984bd5 | [
"MIT"
] | null | null | null | from __future__ import division, print_function, absolute_import
from .cross_entropy_loss import CrossEntropyLoss
from .hard_mine_triplet_loss import TripletLoss
from .mmd_loss import MMDLoss
from .class_memory_loss import ClassMemoryLoss
from .pairwise_matching_loss import PairwiseMatchingLoss
def DeepSupe... | 25.52 | 65 | 0.694357 |
1aa45e80930c707a2fee15e44134a3fb76234b6a | 3,083 | py | Python | backend/corpora/common/authorizer.py | HumanCellAtlas/dcp-prototype | 44ca66a266004124f39d7d3e3dd75e9076012ff0 | [
"MIT"
] | 2 | 2020-02-07T18:12:12.000Z | 2020-02-11T14:59:03.000Z | backend/corpora/common/authorizer.py | HumanCellAtlas/dcp-prototype | 44ca66a266004124f39d7d3e3dd75e9076012ff0 | [
"MIT"
] | 173 | 2020-01-29T17:48:02.000Z | 2020-03-20T02:52:58.000Z | backend/corpora/common/authorizer.py | HumanCellAtlas/dcp-prototype | 44ca66a266004124f39d7d3e3dd75e9076012ff0 | [
"MIT"
] | null | null | null | import os
from functools import lru_cache
import requests
from jose import jwt
from jose.exceptions import ExpiredSignatureError, JWTError, JWTClaimsError
from .corpora_config import CorporaAuthConfig
from backend.corpora.common.utils.http_exceptions import UnauthorizedError
def assert_authorized_token(token: str, ... | 37.597561 | 118 | 0.703536 |
1aa4890314b06c53ebb745b94024caf8f1cd1b74 | 966 | py | Python | savu/plugins/under_revision/xrd_absorption_approximation_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | savu/plugins/under_revision/xrd_absorption_approximation_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | savu/plugins/under_revision/xrd_absorption_approximation_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | from savu.plugins.plugin_tools import PluginTools
class XrdAbsorptionApproximationTools(PluginTools):
"""
McNears absorption correction, takes in a normalised absorption sinogram
and xrd sinogram stack. A base absorption correction for stxm and xrd.
"""
def define_parameters(self):
"""
... | 30.1875 | 76 | 0.561077 |
1aa4a1112ae1059088daae28823143c979b45c88 | 607 | py | Python | oscar/lib/python2.7/site-packages/phonenumbers/shortdata/region_PK.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/shortdata/region_PK.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/shortdata/region_PK.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """Auto-generated file, do not edit by hand. PK metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_PK = PhoneMetadata(id='PK', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='1\\d{1,3}', possible_length=(2, 3, ... | 67.444444 | 129 | 0.731466 |
1aa4b3bf698ea9c6c220323680d9354aacb966a6 | 2,714 | py | Python | salt/states/mysql_user.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | 4 | 2015-10-06T22:20:27.000Z | 2017-09-04T08:03:44.000Z | salt/states/mysql_user.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | null | null | null | salt/states/mysql_user.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | null | null | null | '''
Management of MySQL users.
==========================
NOTE: This module requires the MySQLdb python module and the proper
settings in the minion config file.
See salt.modules.mysql for more information.
The mysql_user module is used to manage MySQL users.
.. code-block:: yaml
frank:
mysql_user.present... | 27.14 | 83 | 0.563375 |
1aa4b888eca86d624cd6981debf2135ccbfa285a | 583 | py | Python | esl/law/legal_person.py | fagan2888/ESL | 24ffa903e8c5b9e725eed9861623d4b6a4a205a2 | [
"Apache-2.0"
] | 1 | 2020-04-17T18:18:08.000Z | 2020-04-17T18:18:08.000Z | esl/law/legal_person.py | fagan2888/ESL | 24ffa903e8c5b9e725eed9861623d4b6a4a205a2 | [
"Apache-2.0"
] | null | null | null | esl/law/legal_person.py | fagan2888/ESL | 24ffa903e8c5b9e725eed9861623d4b6a4a205a2 | [
"Apache-2.0"
] | null | null | null | from typing import Union
from esl.agent import Agent
from esl.law.owner import Owner
from esl.law.property import Property
from esl.law.jurisdiction import Jurisdiction
class LegalPerson(Agent, Owner[Property]):
#representation: Union[LegalEntity, NaturalPerson, Government]
primary_jurisdiction: Jurisdiction... | 32.388889 | 80 | 0.749571 |
1aa4cbdd01c6d28b613627124749418340ac7738 | 20,943 | py | Python | SROMPy/postprocess/Postprocessor.py | datree-demo/SROMPy | 5a5c0d66e823a059568805a1718372c9e80e2943 | [
"Apache-2.0"
] | null | null | null | SROMPy/postprocess/Postprocessor.py | datree-demo/SROMPy | 5a5c0d66e823a059568805a1718372c9e80e2943 | [
"Apache-2.0"
] | null | null | null | SROMPy/postprocess/Postprocessor.py | datree-demo/SROMPy | 5a5c0d66e823a059568805a1718372c9e80e2943 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 United States Government as represented by the Administrator of
# the National Aeronautics and Space Administration. No copyright is claimed in
# the United States under Title 17, U.S. Code. All Other Rights Reserved.
# The Stochastic Reduced Order Models with Python (SROMPy) platform is licensed
# un... | 38.147541 | 83 | 0.545672 |
1aa4d36556e93f312944e46c370460744d0169cd | 2,620 | py | Python | django_attest/assertion.py | bradleyayers/django-attest | e8d0a024cc7439c13361cdc215583ab0bad010bb | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2017-12-11T00:07:11.000Z | 2017-12-11T00:07:11.000Z | django_attest/assertion.py | bradleyayers/django-attest | e8d0a024cc7439c13361cdc215583ab0bad010bb | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | django_attest/assertion.py | bradleyayers/django-attest | e8d0a024cc7439c13361cdc215583ab0bad010bb | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # coding: utf-8
from attest import assert_hook
from contextlib import contextmanager
from django.core.signals import request_started
from django.db import connections, DEFAULT_DB_ALIAS, reset_queries
try:
from urllib.parse import urlsplit
except ImportError: # Python 2
from urlparse import urlsplit
from . impo... | 29.772727 | 81 | 0.648473 |
1aa5087cec5e2faf13acdb709483d298aaea043a | 5,747 | py | Python | emit/utils.py | cstockton/py-emit | 3c240afb4a6159aa3a9a5930c0f6a606d41370b1 | [
"MIT"
] | null | null | null | emit/utils.py | cstockton/py-emit | 3c240afb4a6159aa3a9a5930c0f6a606d41370b1 | [
"MIT"
] | null | null | null | emit/utils.py | cstockton/py-emit | 3c240afb4a6159aa3a9a5930c0f6a606d41370b1 | [
"MIT"
] | 3 | 2017-08-29T22:59:25.000Z | 2020-02-21T19:13:41.000Z | import time
import sys
from datetime import datetime, timedelta
from dateutil.parser import parse
from .globals import conf
__all__ = [
'Backoff', 'Tracker', 'Called', '_debug_assert', '_is_string', '_is_value',
'_timeout_seconds', '_timeout_delta']
def _is_date(value):
if isinstance(value, datetime):
... | 33.219653 | 103 | 0.65582 |
1aa5270f49cb82a99732206428406ccc79e87c62 | 3,727 | py | Python | sushy_tools/static/main.py | arnewiebalck/sushy-tools | 262c7dc48fd2fd3662e05e947a2ee46d09c68757 | [
"Apache-2.0"
] | null | null | null | sushy_tools/static/main.py | arnewiebalck/sushy-tools | 262c7dc48fd2fd3662e05e947a2ee46d09c68757 | [
"Apache-2.0"
] | null | null | null | sushy_tools/static/main.py | arnewiebalck/sushy-tools | 262c7dc48fd2fd3662e05e947a2ee46d09c68757 | [
"Apache-2.0"
] | 1 | 2019-06-05T12:10:04.000Z | 2019-06-05T12:10:04.000Z | # Copyright 2017 Red Hat, Inc.
# 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... | 31.319328 | 79 | 0.599678 |
1aa5275aadc61fa67c9209374709560be159cda0 | 267 | py | Python | greens_func_tools/__init__.py | tbetcke/greens_func_tools | 66812e214f110cf5318381583e70e39f83e0d511 | [
"BSD-3-Clause"
] | null | null | null | greens_func_tools/__init__.py | tbetcke/greens_func_tools | 66812e214f110cf5318381583e70e39f83e0d511 | [
"BSD-3-Clause"
] | null | null | null | greens_func_tools/__init__.py | tbetcke/greens_func_tools | 66812e214f110cf5318381583e70e39f83e0d511 | [
"BSD-3-Clause"
] | null | null | null | """A library for the evaluation of Greens functions."""
from .greens_func_tools import ffi, lib
def test():
"""Test the library."""
import pytest
import os
current_dir = os.path.dirname(os.path.abspath(__file__))
pytest.main([current_dir])
| 22.25 | 60 | 0.677903 |
1aa52e5b9dddde463a36e863d7915ac23466937d | 610 | py | Python | fibAndPal.py | mushahidmehdi/MITx-6.00.1x | 44a1b9bb87b5feb8d5a5ac7a8dec59e689dab5be | [
"MIT"
] | null | null | null | fibAndPal.py | mushahidmehdi/MITx-6.00.1x | 44a1b9bb87b5feb8d5a5ac7a8dec59e689dab5be | [
"MIT"
] | null | null | null | fibAndPal.py | mushahidmehdi/MITx-6.00.1x | 44a1b9bb87b5feb8d5a5ac7a8dec59e689dab5be | [
"MIT"
] | null | null | null |
# Fibonacci sequence!
def fibonacci(n):
if n == 0 or n == 1:
return 1
else:
return fibonacci(n-1) + fibonacci(n-2)
fib = fibonacci(10)
#print(fib)
# Palindrimic Sequence
def isPalindromic(x):
def is_char(x):
x = x.lower()
letters = 'abcdefghijkmnopqrstuvwxyz'
ans = ""
for i in x:
if i in l... | 13.555556 | 56 | 0.639344 |
1aa536b653ab1745d77f1824d256687f26502d3b | 11,008 | py | Python | frameit/EvalAFrame.py | biggorilla-gh/frameit | 9cae56b4089fff6c955f8b86c699aa402a1390ac | [
"Apache-2.0"
] | 3 | 2018-12-29T01:10:37.000Z | 2020-06-12T09:45:11.000Z | frameit/EvalAFrame.py | biggorilla-gh/frameit | 9cae56b4089fff6c955f8b86c699aa402a1390ac | [
"Apache-2.0"
] | null | null | null | frameit/EvalAFrame.py | biggorilla-gh/frameit | 9cae56b4089fff6c955f8b86c699aa402a1390ac | [
"Apache-2.0"
] | null | null | null | import xml.etree.ElementTree as ET
from frameit import SRL, FrameLabel, Frame, Utterance
class EvalToken:
def __init__(self, text, idx):
self.text = text
self.idx = idx
def evalFrame(frame_filename, gold_filename, verbose_frame=False, verbose_attribute=False, limit=5, skip=None, fuzzy=False, gene... | 49.809955 | 202 | 0.583757 |
1aa564d5bc143ab36b997ff587261b19edb18238 | 2,615 | py | Python | scripts/hex_compress_and_put_pv.py | GustavLero/EPICS-inst_servers | 4bcdd6a80f1d9e074de3f0f7c66968d506981988 | [
"BSD-3-Clause"
] | null | null | null | scripts/hex_compress_and_put_pv.py | GustavLero/EPICS-inst_servers | 4bcdd6a80f1d9e074de3f0f7c66968d506981988 | [
"BSD-3-Clause"
] | null | null | null | scripts/hex_compress_and_put_pv.py | GustavLero/EPICS-inst_servers | 4bcdd6a80f1d9e074de3f0f7c66968d506981988 | [
"BSD-3-Clause"
] | null | null | null | # This file is part of the ISIS IBEX application.
# Copyright (C) 2012-2016 Science & Technology Facilities Council.
# All rights reserved.
#
# This program is distributed in the hope that it will be useful.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License... | 34.866667 | 104 | 0.732696 |
1aa594eb8ea01246acaac98286510841711d070f | 1,930 | py | Python | qualipy/helper/_cli.py | baasman/qualipy | e246a44ea3a5dcc92291983c52a89189338f808f | [
"Apache-2.0"
] | 1 | 2019-07-15T15:16:44.000Z | 2019-07-15T15:16:44.000Z | qualipy/helper/_cli.py | baasman/qualipy | e246a44ea3a5dcc92291983c52a89189338f808f | [
"Apache-2.0"
] | null | null | null | qualipy/helper/_cli.py | baasman/qualipy | e246a44ea3a5dcc92291983c52a89189338f808f | [
"Apache-2.0"
] | null | null | null | from qualipy.helper.auto_qpy import (
setup_auto_qpy_sql_table,
setup_auto_qpy_pandas_table,
)
import qualipy as qpy
import sqlalchemy as sa
def _setup_sql_table_project(conf, config_dir, project_name, spec) -> qpy.Project:
table_name = spec["table_name"]
schema = spec.get("schema")
tracking_db =... | 29.692308 | 82 | 0.667876 |
1aa5aa9723cd124e123c99e56b5fde3d3577c561 | 9,740 | py | Python | flow/training.py | jacopotagliabue/no-ops-machine-learning | 2d61cca9f375ee2d8f897b18e634976e04edf1c1 | [
"MIT"
] | 21 | 2021-02-12T02:09:40.000Z | 2022-03-06T18:27:20.000Z | flow/training.py | jacopotagliabue/no-ops-machine-learning | 2d61cca9f375ee2d8f897b18e634976e04edf1c1 | [
"MIT"
] | null | null | null | flow/training.py | jacopotagliabue/no-ops-machine-learning | 2d61cca9f375ee2d8f897b18e634976e04edf1c1 | [
"MIT"
] | 4 | 2021-02-12T13:40:58.000Z | 2021-12-04T20:39:53.000Z | """
This is a one-script MetaFlow project, showing how to go from a dataset file to an endpoint serving predictions through
a repeatable, modular and scalable process (DAG-based). More importantly, all of this is achieved from a developer
laptop setup, without explicitely deploying *any infrastructure*.
The functions... | 45.302326 | 119 | 0.658932 |
1aa5b59b8e2d003bebab2f651ef730cb93dbe039 | 43,887 | py | Python | src/python/bot/testcase_manager.py | isabella232/clusterfuzz | a2bd192dd49e602967789488971777097f1192b7 | [
"Apache-2.0"
] | null | null | null | src/python/bot/testcase_manager.py | isabella232/clusterfuzz | a2bd192dd49e602967789488971777097f1192b7 | [
"Apache-2.0"
] | null | null | null | src/python/bot/testcase_manager.py | isabella232/clusterfuzz | a2bd192dd49e602967789488971777097f1192b7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.768503 | 117 | 0.697997 |
1aa5c096f31b5a46d31a07fa3b4adbee9396ea48 | 6,031 | py | Python | guided_diffusion/two_parts_model.py | KamilDeja/guided-diffusion | d0eeeb4637379a3ece40c4dd38ccdf5d8ed5e837 | [
"MIT"
] | null | null | null | guided_diffusion/two_parts_model.py | KamilDeja/guided-diffusion | d0eeeb4637379a3ece40c4dd38ccdf5d8ed5e837 | [
"MIT"
] | null | null | null | guided_diffusion/two_parts_model.py | KamilDeja/guided-diffusion | d0eeeb4637379a3ece40c4dd38ccdf5d8ed5e837 | [
"MIT"
] | null | null | null | import torch as th
import torch.nn as nn
from guided_diffusion.unet import UNetModel
class TwoPartsUNetModel(nn.Module):
"""
The full UNet model with attention and timestep embedding.
:param in_channels: channels in the input Tensor.
:param model_channels: base channel count for the model.
:par... | 41.881944 | 100 | 0.547836 |
1aa5dfaf627fa839c0644b1e3060a0fb4c59488a | 3,562 | py | Python | lab/lab02/lab02.py | suvix/cs61a-fa19 | 53a0ecf29d13fc13113894255b6422eba0f82832 | [
"MIT"
] | null | null | null | lab/lab02/lab02.py | suvix/cs61a-fa19 | 53a0ecf29d13fc13113894255b6422eba0f82832 | [
"MIT"
] | null | null | null | lab/lab02/lab02.py | suvix/cs61a-fa19 | 53a0ecf29d13fc13113894255b6422eba0f82832 | [
"MIT"
] | null | null | null | def lambda_curry2(func):
"""
Returns a Curried version of a two-argument function FUNC.
>>> from operator import add, mul, mod
>>> curried_add = lambda_curry2(add)
>>> add_three = curried_add(3)
>>> add_three(5)
8
>>> curried_mul = lambda_curry2(mul)
>>> mul_5 = curried_mul(5)
>>... | 26.984848 | 92 | 0.536496 |
1aa6073119c74bd3fcc619b65ced613475b62305 | 855 | py | Python | src/preprocessing/split_data.py | dem123456789/Speech-Emotion-Recognition-with-Dual-Sequence-LSTM-Architecture | a072cb940201bbcdb2d0f4d0dfa1dde478fa4464 | [
"MIT"
] | 6 | 2020-08-03T03:13:25.000Z | 2022-02-11T08:32:10.000Z | src/preprocessing/split_data.py | dem123456789/Speech-Emotion-Recognition-with-Dual-Sequence-LSTM-Architecture | a072cb940201bbcdb2d0f4d0dfa1dde478fa4464 | [
"MIT"
] | 1 | 2020-09-08T16:10:38.000Z | 2020-09-08T16:10:38.000Z | src/preprocessing/split_data.py | dem123456789/Speech-Emotion-Recognition-with-Dual-Sequence-LSTM-Architecture | a072cb940201bbcdb2d0f4d0dfa1dde478fa4464 | [
"MIT"
] | 2 | 2020-08-03T21:37:21.000Z | 2021-03-26T02:19:17.000Z | import pickle
from sklearn.model_selection import train_test_split
file = open('./IEMOCAP_dictionary_5.pkl', 'rb')
data = pickle.load(file)
input_train, input_test, target_train, target_test, seq_length_train, seq_length_test = train_test_split(data["input"], data["target"], data["seq_length"], test_size=0.2, random_... | 45 | 187 | 0.776608 |
1aa64e4615478f10b20014ccab58902d6918d4c8 | 8,872 | py | Python | celery/backends/base.py | gthb/celery | 13057dc69a6ecda6aabfae7b7640d971176251fb | [
"BSD-3-Clause"
] | null | null | null | celery/backends/base.py | gthb/celery | 13057dc69a6ecda6aabfae7b7640d971176251fb | [
"BSD-3-Clause"
] | null | null | null | celery/backends/base.py | gthb/celery | 13057dc69a6ecda6aabfae7b7640d971176251fb | [
"BSD-3-Clause"
] | null | null | null | """celery.backends.base"""
import time
from celery import conf
from celery import states
from celery.exceptions import TimeoutError, TaskRevokedError
from celery.serialization import pickle, get_pickled_exception
from celery.serialization import get_pickleable_exception
from celery.datastructures import LocalCache
c... | 36.212245 | 76 | 0.639653 |
1aa65af42e6e6ef443578b7a10a3b4535e08f859 | 3,184 | py | Python | audio.py | tippesi/Python-Audio | 2311723e544a9e34dc33b888b07778efe849e46e | [
"BSD-3-Clause"
] | 1 | 2019-04-01T13:26:50.000Z | 2019-04-01T13:26:50.000Z | audio.py | tippesi/Python-Audio | 2311723e544a9e34dc33b888b07778efe849e46e | [
"BSD-3-Clause"
] | null | null | null | audio.py | tippesi/Python-Audio | 2311723e544a9e34dc33b888b07778efe849e46e | [
"BSD-3-Clause"
] | null | null | null | # External imports
import pyaudio
import wave
import struct
import sys
import math
# Internal imports
import postprocessing.audio_postprocessing
from pitchprocessing.linear_pitchprocessing import LinearPitchProcessing
class Audio():
"""
"""
def __init__(self, filename, chunksize, paudio):
files... | 34.236559 | 114 | 0.632852 |
1aa663215517724cd665e66da6b0488aa7aec058 | 5,562 | py | Python | speedcom/Prediction.py | emissible/emissilbe | 5537e787ccb883a101d2d40b38d480e257ac9755 | [
"MIT"
] | 1 | 2019-02-20T05:11:16.000Z | 2019-02-20T05:11:16.000Z | speedcom/Prediction.py | emissible/emissilbe | 5537e787ccb883a101d2d40b38d480e257ac9755 | [
"MIT"
] | null | null | null | speedcom/Prediction.py | emissible/emissilbe | 5537e787ccb883a101d2d40b38d480e257ac9755 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import os
from utilities import visualize
from scipy.stats import boxcox
from dataUtils import DataUtils
from keras.models import model_from_json
from scipy.special import inv_boxcox
MODEL_PATH = os.path.dirname(__file__)
MODEL_PATH = os.path.join(MODEL_PATH, 'saved_models')
cla... | 28.96875 | 105 | 0.598885 |
1aa6a0bc85915a3ea4c62fd4ab80f82753869152 | 244 | py | Python | test/disable_result0.py | sergey-serebryakov/mpipe | 5a1804cf64271931f0cd3e4fff3e2b38291212dd | [
"MIT"
] | null | null | null | test/disable_result0.py | sergey-serebryakov/mpipe | 5a1804cf64271931f0cd3e4fff3e2b38291212dd | [
"MIT"
] | null | null | null | test/disable_result0.py | sergey-serebryakov/mpipe | 5a1804cf64271931f0cd3e4fff3e2b38291212dd | [
"MIT"
] | null | null | null | from mpipe import OrderedStage, Pipeline
def yes(value):
return value
pipe = Pipeline(OrderedStage(yes, disable_result=True))
for number in range(10):
pipe.put(number)
pipe.put(None)
for result in pipe.results():
print(result)
| 16.266667 | 55 | 0.72541 |
1aa6a8e6bb1d15eb15d96b487f421475b3107361 | 612 | py | Python | day03/puzzle1.py | techrabbit58/AdventOfCode2020 | 9e0f4a633f50f5dd48186d38fe58ad8d40dff387 | [
"Unlicense"
] | 1 | 2020-12-15T22:27:38.000Z | 2020-12-15T22:27:38.000Z | day03/puzzle1.py | techrabbit58/AdventOfCode2020 | 9e0f4a633f50f5dd48186d38fe58ad8d40dff387 | [
"Unlicense"
] | null | null | null | day03/puzzle1.py | techrabbit58/AdventOfCode2020 | 9e0f4a633f50f5dd48186d38fe58ad8d40dff387 | [
"Unlicense"
] | null | null | null | """
Advent Of Code 2020. Day 03. Puzzle 1.
"""
import time
input_file = 'day03.txt'
def parse(puzzle_input):
with open(puzzle_input) as f:
lines = f.read().strip().split()
return lines
TREE = '#'
def solution(forest):
width = len(forest[0])
x_pos = 0
x_step = 3
trees = 0
for n... | 18 | 56 | 0.591503 |
1aa6d3f8d1692f0694ebfeb66fcc5736d124fef7 | 2,354 | py | Python | pcdet/models/detectors/second_fpn_nounetonly.py | zhangweichen2006/SRDAN_Open | 47c1bd9d2369d8e486b18a7aea220af7324c9011 | [
"Apache-2.0"
] | 8 | 2021-06-23T02:06:56.000Z | 2022-03-18T08:34:32.000Z | pcdet/models/detectors/second_fpn_nounetonly.py | zhangweichen2006/SRDAN_Open | 47c1bd9d2369d8e486b18a7aea220af7324c9011 | [
"Apache-2.0"
] | 2 | 2021-07-17T11:19:14.000Z | 2021-09-25T03:30:36.000Z | pcdet/models/detectors/second_fpn_nounetonly.py | zhangweichen2006/SRDAN_Open | 47c1bd9d2369d8e486b18a7aea220af7324c9011 | [
"Apache-2.0"
] | null | null | null | from .detector3d_template import Detector3DTemplate
class SECONDFPNNOUNetOnly(Detector3DTemplate):
def __init__(self, model_cfg, num_class, dataset, nusc=False):
super().__init__(model_cfg=model_cfg, num_class=num_class, dataset=dataset, nusc=nusc)
self.module_list = self.build_networks()
... | 37.967742 | 202 | 0.599405 |
1aa6dc29a108e7186399cbd5a23e7d18ef9134f8 | 1,631 | py | Python | config/urls.py | jsaunders/resource_manager | 29d106bec49f74c4b2d9ecd8cab1b788eb1477e0 | [
"MIT"
] | null | null | null | config/urls.py | jsaunders/resource_manager | 29d106bec49f74c4b2d9ecd8cab1b788eb1477e0 | [
"MIT"
] | null | null | null | config/urls.py | jsaunders/resource_manager | 29d106bec49f74c4b2d9ecd8cab1b788eb1477e0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
from r... | 40.775 | 110 | 0.717351 |
1aa6e64b64560e2f048c3d0d51957dabdc5c1b2b | 4,651 | py | Python | drheader/validators/cookie_validator.py | manuel-sommer/DrHeader | c2098d592578b046e77df44445651b66394e0d49 | [
"MIT"
] | null | null | null | drheader/validators/cookie_validator.py | manuel-sommer/DrHeader | c2098d592578b046e77df44445651b66394e0d49 | [
"MIT"
] | null | null | null | drheader/validators/cookie_validator.py | manuel-sommer/DrHeader | c2098d592578b046e77df44445651b66394e0d49 | [
"MIT"
] | null | null | null | """Validator module for cookies."""
from drheader import report, utils
from drheader.validators import base
_DELIMITER_TYPE = 'item_delimiter'
class CookieValidator(base.ValidatorBase):
"""Validator class for validating cookies.
Attributes:
cookies (CaseInsensitiveDict): The cookies to analyse.
... | 42.281818 | 120 | 0.660288 |
1aa6f99651350d3712cb6615ea58e7b9c87b8fe3 | 7,461 | py | Python | study/convert-tdms-to-excel.py | CrtomirJuren/npTDMS | cbebbf31d3977af06dbfa7f9602c89627134621d | [
"MIT"
] | 2 | 2021-02-04T05:40:01.000Z | 2021-04-06T14:34:55.000Z | study/convert-tdms-to-excel.py | CrtomirJuren/npTDMS | cbebbf31d3977af06dbfa7f9602c89627134621d | [
"MIT"
] | null | null | null | study/convert-tdms-to-excel.py | CrtomirJuren/npTDMS | cbebbf31d3977af06dbfa7f9602c89627134621d | [
"MIT"
] | 2 | 2021-02-04T05:40:15.000Z | 2021-12-25T06:07:54.000Z | # -*- coding: utf-8 -*-
"""
Script to Convert .tdms to .xlsx
Created on Wed Nov 25 16:09:49 2020
@author: crtjur
"""
#---------------------------------------------------
#----------------------imports----------------------
#---------------------------------------------------
import os
import numpy as np
import pandas... | 27.633333 | 139 | 0.589197 |
1aa6fc1218e1f264b12190ecffbf9e50f88aca87 | 10,045 | py | Python | mdrsl/rule_generation/association_rule_mining/fim_impl/mine_st_rules_with_fim.py | joschout/Multi-Directional-Rule-Set-Learning | ef0620b115f4e0fd7fba3e752d238a8020c1ca6b | [
"Apache-2.0"
] | 3 | 2020-08-03T19:25:44.000Z | 2021-06-27T22:25:55.000Z | mdrsl/rule_generation/association_rule_mining/fim_impl/mine_st_rules_with_fim.py | joschout/Multi-Directional-Rule-Set-Learning | ef0620b115f4e0fd7fba3e752d238a8020c1ca6b | [
"Apache-2.0"
] | null | null | null | mdrsl/rule_generation/association_rule_mining/fim_impl/mine_st_rules_with_fim.py | joschout/Multi-Directional-Rule-Set-Learning | ef0620b115f4e0fd7fba3e752d238a8020c1ca6b | [
"Apache-2.0"
] | 2 | 2020-08-07T22:54:28.000Z | 2021-02-18T06:11:01.000Z | import random
import time
from typing import List, Optional, Dict
import fim
import pandas as pd
from pyarc.data_structures.antecedent import Antecedent
from pyarc.data_structures.consequent import Consequent
from pyarc.data_structures.item import Item
from pyarc.data_structures.car import ClassAssocationRule
from p... | 35.4947 | 138 | 0.623295 |
1aa71eebad8949364f5b129ede1fbdec5d7eb32b | 6,145 | py | Python | gui.py | ZackDowning/Access-Mapper | 5d40d76c421f6dfdb13a6d7da4266d4e109ef975 | [
"MIT"
] | null | null | null | gui.py | ZackDowning/Access-Mapper | 5d40d76c421f6dfdb13a6d7da4266d4e109ef975 | [
"MIT"
] | null | null | null | gui.py | ZackDowning/Access-Mapper | 5d40d76c421f6dfdb13a6d7da4266d4e109ef975 | [
"MIT"
] | null | null | null | import PySimpleGUI as Sg
f = {
'font': 'Helvetica',
'size': {
'small': '12',
'medium': '14',
'large': '16'
}}
s_font = f'{f["font"]} {f["size"]["small"]}'
m_font = f'{f["font"]} {f["size"]["medium"]}'
l_font = f'{f["font"]} {f["size"]["large"]}'
window_title = 'Access Mapper'
def ... | 32.68617 | 101 | 0.648495 |
1aa728b515759aa307394f4a78a2af3bc66a0bd5 | 320 | py | Python | lib/stl/__about__.py | hdo/bCNC | c0c6489c80265f95b554e6566835874497cf969d | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/stl/__about__.py | hdo/bCNC | c0c6489c80265f95b554e6566835874497cf969d | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/stl/__about__.py | hdo/bCNC | c0c6489c80265f95b554e6566835874497cf969d | [
"MIT",
"BSD-3-Clause"
] | null | null | null | __package_name__ = 'numpy-stl'
__import_name__ = 'stl'
__version__ = '2.7.0'
__author__ = 'Rick van Hattem'
__author_email__ = 'Wolph@Wol.ph'
__description__ = ' '.join('''
Library to make reading, writing and modifying both binary and ascii STL files
easy.
'''.split())
__url__ = 'https://github.com/WoLpH/numpy-stl/'
| 26.666667 | 78 | 0.725 |
1aa7323a47966ec07cc53e53c590a1f80c829bb0 | 50,506 | py | Python | pint/unit.py | natezb/pint | 0a1ad472c3985cc51d36cffc08f305c8171cef0b | [
"BSD-3-Clause"
] | null | null | null | pint/unit.py | natezb/pint | 0a1ad472c3985cc51d36cffc08f305c8171cef0b | [
"BSD-3-Clause"
] | null | null | null | pint/unit.py | natezb/pint | 0a1ad472c3985cc51d36cffc08f305c8171cef0b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pint.unit
~~~~~~~~~
Functions and classes related to unit definitions and conversions.
:copyright: 2013 by Pint Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import division, unicode_literals, print_function, ab... | 36.75837 | 112 | 0.589772 |
1aa7867d41f8d4bc96aa112e340d02360584fe4f | 3,435 | py | Python | mauveinternet/shortcuts.py | lordmauve/django-mauveinternet | 0c4143021c16f7ae7b6f60da0f3f9ab37ff9eaad | [
"MIT"
] | null | null | null | mauveinternet/shortcuts.py | lordmauve/django-mauveinternet | 0c4143021c16f7ae7b6f60da0f3f9ab37ff9eaad | [
"MIT"
] | null | null | null | mauveinternet/shortcuts.py | lordmauve/django-mauveinternet | 0c4143021c16f7ae7b6f60da0f3f9ab37ff9eaad | [
"MIT"
] | null | null | null | import sys
from django.http import HttpResponse, HttpResponseForbidden
from django.shortcuts import render
from django.template import RequestContext, loader
def template(request, templ, **kwargs):
"""Shortcut for creating a response using a template.
This used to be a convenient shortcut for calling render... | 32.714286 | 110 | 0.717322 |
1aa7a8370204d2c399be583b9c844b32f643d09b | 18,039 | py | Python | tests/func/test_checkout.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | 1 | 2019-09-02T00:28:11.000Z | 2019-09-02T00:28:11.000Z | tests/func/test_checkout.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | null | null | null | tests/func/test_checkout.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | 1 | 2019-09-02T00:29:40.000Z | 2019-09-02T00:29:40.000Z | import os
import sys
import re
import shutil
import filecmp
import collections
import logging
from dvc.main import main
from dvc import progress
from dvc.repo import Repo as DvcRepo
from dvc.system import System
from dvc.utils import walk_files, relpath
from dvc.utils.stage import load_stage_file, dump_stage_file
fro... | 30.888699 | 79 | 0.631077 |
1aa7ba5e35583ca77df13628cf446be2177b52a9 | 613 | py | Python | setup.py | adamchainz/simple | 5f598024d521724c6b1076ec021064506af7847c | [
"MIT"
] | 75 | 2015-01-04T03:45:02.000Z | 2020-11-17T08:58:57.000Z | setup.py | adamchainz/simple | 5f598024d521724c6b1076ec021064506af7847c | [
"MIT"
] | 7 | 2015-01-26T15:35:22.000Z | 2018-10-25T15:00:46.000Z | setup.py | adamchainz/simple | 5f598024d521724c6b1076ec021064506af7847c | [
"MIT"
] | 22 | 2015-01-01T16:41:41.000Z | 2022-03-30T14:41:21.000Z | from setuptools import setup
setup(
name='simpleblogging',
version='2.0.13',
packages=['simple'],
url='https://github.com/orf/simple',
license='MIT',
author='Orf',
author_email='tom@tomforb.es',
description='A simple markdown based blog.',
include_package_data=True,
install_requ... | 27.863636 | 86 | 0.631321 |
1aa7c09ff07b4a321095a13b5cb3196d4ce33be9 | 1,681 | py | Python | ngsutils/bam/t/test_split.py | bgruening/ngsutils | 417e90dc1918fb553dd84990f2c54bd8cea8f44d | [
"BSD-3-Clause"
] | 57 | 2015-03-09T01:26:45.000Z | 2022-02-22T07:26:01.000Z | ngsutils/bam/t/test_split.py | bgruening/ngsutils | 417e90dc1918fb553dd84990f2c54bd8cea8f44d | [
"BSD-3-Clause"
] | 33 | 2015-02-03T23:24:46.000Z | 2022-03-16T20:08:10.000Z | ngsutils/bam/t/test_split.py | bgruening/ngsutils | 417e90dc1918fb553dd84990f2c54bd8cea8f44d | [
"BSD-3-Clause"
] | 33 | 2015-01-18T16:47:47.000Z | 2022-02-22T07:28:09.000Z | #!/usr/bin/env python
'''
Tests for bamutils split
'''
import os
import unittest
import ngsutils.bam
import ngsutils.bam.split
class SplitTest(unittest.TestCase):
def testSplit(self):
'''
Merge test.bam and test2.bam to tmp.bam
'''
fname1 = os.path.join(os.path.dirname(__file__),... | 27.112903 | 72 | 0.580012 |
1aa7d389bb7a27eaca93515a7a1707a7abcc9f9b | 3,953 | py | Python | armi/utils/tests/test_flags.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/utils/tests/test_flags.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/utils/tests/test_flags.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 30.643411 | 140 | 0.620288 |
1aa7ee5e7dd8a6f7460aaf01a4c6785908a9f295 | 1,036 | py | Python | alipay/aop/api/response/AlipayBossFncGfaccruedprodCumpoaccbalamtQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayBossFncGfaccruedprodCumpoaccbalamtQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayBossFncGfaccruedprodCumpoaccbalamtQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.PoCumAccruedBalanceAmtDTO import PoCumAccruedBalanceAmtDTO
class AlipayBossFncGfaccruedprodCumpoaccbalamtQueryResponse(AlipayResponse):
def __init__(self):
... | 34.533333 | 126 | 0.748069 |
1aa7fbe1a0f43bc793faf707ad94f1907b234363 | 3,871 | py | Python | lib/streamlit/elements/altair.py | dwiel/streamlit | 74ae7f30cc3d95948aff311371449963f8eaf29e | [
"Apache-2.0"
] | 1 | 2020-01-04T06:45:37.000Z | 2020-01-04T06:45:37.000Z | lib/streamlit/elements/altair.py | yutiansut/streamlit | 929942f755ca40f859a03d905ffcbf743f45dffa | [
"Apache-2.0"
] | null | null | null | lib/streamlit/elements/altair.py | yutiansut/streamlit | 929942f755ca40f859a03d905ffcbf743f45dffa | [
"Apache-2.0"
] | 1 | 2020-06-26T14:41:01.000Z | 2020-06-26T14:41:01.000Z | # -*- coding: utf-8 -*-
# Copyright 2018-2019 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 31.729508 | 88 | 0.665203 |
1aa82c12f82bfa64c03c996654535d781d1fb627 | 1,780 | py | Python | arjuna/tpi/guiauto/base/locatable.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna/tpi/guiauto/base/locatable.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna/tpi/guiauto/base/locatable.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | # This file is a part of Arjuna
# Copyright 2015-2020 Rahul Verma
# Website: www.RahulVerma.net
# 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... | 28.709677 | 124 | 0.658989 |
1aa8594b7f86826946b418f0a5232cd66542074e | 25,755 | py | Python | eventsourcing/tests/sequenced_item_tests/base.py | alexanderlarin/eventsourcing | 6f2a4ded3c783ba3ee465243a48f66ecdee20f52 | [
"BSD-3-Clause"
] | null | null | null | eventsourcing/tests/sequenced_item_tests/base.py | alexanderlarin/eventsourcing | 6f2a4ded3c783ba3ee465243a48f66ecdee20f52 | [
"BSD-3-Clause"
] | null | null | null | eventsourcing/tests/sequenced_item_tests/base.py | alexanderlarin/eventsourcing | 6f2a4ded3c783ba3ee465243a48f66ecdee20f52 | [
"BSD-3-Clause"
] | null | null | null | import json
import uuid
from abc import abstractmethod
from time import sleep
from uuid import uuid4
from eventsourcing.application.policies import PersistencePolicy
from eventsourcing.domain.model.entity import VersionedEntity
from eventsourcing.domain.model.events import EventWithOriginatorID, EventWithOriginatorVer... | 39.806801 | 118 | 0.673617 |
1aa87a710818cede1769e9c4531877f574831e55 | 4,901 | py | Python | pynd/cli.py | d0ugal/pynd | a08172d5b2232e9eead1a1b23d50c648989f3dfe | [
"Apache-2.0"
] | 24 | 2016-12-23T10:09:30.000Z | 2021-04-21T05:20:11.000Z | pynd/cli.py | d0ugal/pynd | a08172d5b2232e9eead1a1b23d50c648989f3dfe | [
"Apache-2.0"
] | 11 | 2016-12-23T08:00:36.000Z | 2017-03-27T07:50:30.000Z | pynd/cli.py | d0ugal/pynd | a08172d5b2232e9eead1a1b23d50c648989f3dfe | [
"Apache-2.0"
] | 3 | 2016-12-28T19:25:19.000Z | 2020-04-26T20:39:53.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed u... | 40.841667 | 79 | 0.600694 |
1aa87b9739d3fa1fea442fd8dc4ea1fb49568d7b | 2,710 | py | Python | src/linakdeskapp/gui/devices_list_dialog.py | nilp0inter/LinakDeskApp | 0cf287ee96002f5c270c087ba73b72c548baa8c5 | [
"MIT"
] | 121 | 2018-09-19T20:10:21.000Z | 2022-03-31T08:07:33.000Z | src/linakdeskapp/gui/devices_list_dialog.py | nilp0inter/LinakDeskApp | 0cf287ee96002f5c270c087ba73b72c548baa8c5 | [
"MIT"
] | 13 | 2020-02-19T15:58:37.000Z | 2022-03-05T03:20:42.000Z | src/linakdeskapp/gui/devices_list_dialog.py | nilp0inter/LinakDeskApp | 0cf287ee96002f5c270c087ba73b72c548baa8c5 | [
"MIT"
] | 12 | 2020-02-13T23:55:30.000Z | 2022-01-30T15:11:31.000Z | # MIT License
#
# Copyright (c) 2017 Arkadiusz Netczuk <dev.arnet@gmail.com>
#
# 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
# t... | 34.303797 | 80 | 0.707749 |
1aa87d76744f564dec957a376a7dcdf4f46d4628 | 515 | py | Python | systemtests/sessionutils.py | jonathanmendez/nitsm-python | c7bbe2e53d56cf987d2369336d32b8baf6ae806a | [
"MIT"
] | null | null | null | systemtests/sessionutils.py | jonathanmendez/nitsm-python | c7bbe2e53d56cf987d2369336d32b8baf6ae806a | [
"MIT"
] | null | null | null | systemtests/sessionutils.py | jonathanmendez/nitsm-python | c7bbe2e53d56cf987d2369336d32b8baf6ae806a | [
"MIT"
] | null | null | null | import re
def get_resource_name_from_session(session) -> str:
"""
session.io_resource_descriptor isn't 100% reliable for simulated sessions. This method uses a
regular expression to get the resource name from the object's repr.
"""
return re.search(r"resource_name='(\w*)'", repr(session)).group(1... | 32.1875 | 97 | 0.695146 |
1aa883aa8361492575b981d1c5099de9c2453058 | 1,367 | py | Python | app/recipe/models.py | MahmudulHassan5809/recipe-app-api-drf | 10d841dbfbf9e38d9c238138501af592bea4f656 | [
"MIT"
] | null | null | null | app/recipe/models.py | MahmudulHassan5809/recipe-app-api-drf | 10d841dbfbf9e38d9c238138501af592bea4f656 | [
"MIT"
] | null | null | null | app/recipe/models.py | MahmudulHassan5809/recipe-app-api-drf | 10d841dbfbf9e38d9c238138501af592bea4f656 | [
"MIT"
] | null | null | null | from django.db import models
from django.conf import settings
import uuid
import os
def recipe_image_file_path(instance,filename):
"""Generate file path for new recipe image"""
ext = filename.split('.')[-1]
filename = f'{uuid.uuid4()}.{ext}'
return os.path.join('uploads/recipe/',filename)
class Tag(... | 30.377778 | 82 | 0.712509 |
1aa887de043c7b63ca980dbc595729d353159c2e | 4,973 | py | Python | scripts/python/statistics/Nevada/create_nevada_noticed_time.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | 2 | 2020-06-03T15:59:50.000Z | 2020-12-21T11:11:57.000Z | scripts/python/statistics/Nevada/create_nevada_noticed_time.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | null | null | null | scripts/python/statistics/Nevada/create_nevada_noticed_time.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | 2 | 2019-10-02T06:47:23.000Z | 2020-02-02T18:32:23.000Z | #!/usr/bin/env python
"""Adds a time stamp in the nevada csv file"""
# ============================================================================== #
# #
# (c) Copyright, 2013 University Corporation for Atmospheric Research (UCAR). #
... | 37.11194 | 141 | 0.56485 |
1aa8c3978bd000e439980c13906b8e028e92fb97 | 176 | py | Python | src/computation.py | kedenk/evm-bytecode-tool | 838be9ad1edef3222de1c83bcd2b4955cded0992 | [
"MIT"
] | null | null | null | src/computation.py | kedenk/evm-bytecode-tool | 838be9ad1edef3222de1c83bcd2b4955cded0992 | [
"MIT"
] | null | null | null | src/computation.py | kedenk/evm-bytecode-tool | 838be9ad1edef3222de1c83bcd2b4955cded0992 | [
"MIT"
] | null | null | null | import src.stack as st
class Computation(object):
def __init__(self, stack: st.Stack):
self.stack = stack
def clear_stack(self):
self.stack.clear()
| 16 | 40 | 0.642045 |
1aa8dabfd12243cbcf270aee7835fe333d8f260e | 499 | py | Python | hfpy_code/chapter4/page108.py | leobarros/use_cabeca_python | 4e0897a68fb7ef669ec05eab7cba9412baa0e85e | [
"Apache-2.0"
] | 1 | 2016-04-01T04:31:52.000Z | 2016-04-01T04:31:52.000Z | hfpython_code/hfpy_code/chapter4/page108.py | tdean1995/HFPythonSandbox | dc72257e4353c5bca7a2c401d18587c6d799f9a1 | [
"Apache-2.0"
] | null | null | null | hfpython_code/hfpy_code/chapter4/page108.py | tdean1995/HFPythonSandbox | dc72257e4353c5bca7a2c401d18587c6d799f9a1 | [
"Apache-2.0"
] | 1 | 2020-06-02T17:47:22.000Z | 2020-06-02T17:47:22.000Z |
man = []
other = []
try:
data = open('sketch.txt')
for each_line in data:
try:
(role, line_spoken) = each_line.split(':', 1)
line_spoken = line_spoken.strip()
if role == 'Man':
man.append(line_spoken)
elif role == 'Other Man':
... | 18.481481 | 57 | 0.517034 |
1aa90ed5d304fe8fb73c0787eb2684eebe1b9860 | 1,882 | py | Python | tests/test_dataframe.py | mattloose/read-paf | b3749a34242e22d51d6f5120cd51632ee738d06b | [
"MIT"
] | null | null | null | tests/test_dataframe.py | mattloose/read-paf | b3749a34242e22d51d6f5120cd51632ee738d06b | [
"MIT"
] | null | null | null | tests/test_dataframe.py | mattloose/read-paf | b3749a34242e22d51d6f5120cd51632ee738d06b | [
"MIT"
] | null | null | null | import os
import pandas as pd
from readpaf import parse_paf
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
STATIC_FILES = os.path.join(os.path.dirname(os.path.realpath(__file__)), "static_files")
PAF_FILE = os.path.join(STATIC_FILES, "test.paf")
MISSING_LINE = os.path.join(STAT... | 28.089552 | 126 | 0.626461 |
1aa91373f589da47dcc9c887389b3aa3ede66947 | 44,830 | py | Python | sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from io im... | 53.49642 | 119 | 0.650145 |
1aa91beefad4fb672187fb02cb06468bea77ee27 | 525 | py | Python | leetcode/medium/406-Queue_reconstruction_by_height.py | shubhamoli/practice | 5a24fdeb6e5f43b821ef0510fe3b343ddda18f22 | [
"MIT"
] | 1 | 2020-02-25T10:32:27.000Z | 2020-02-25T10:32:27.000Z | leetcode/medium/406-Queue_reconstruction_by_height.py | shubhamoli/practice | 5a24fdeb6e5f43b821ef0510fe3b343ddda18f22 | [
"MIT"
] | null | null | null | leetcode/medium/406-Queue_reconstruction_by_height.py | shubhamoli/practice | 5a24fdeb6e5f43b821ef0510fe3b343ddda18f22 | [
"MIT"
] | null | null | null | """
Leetcode #406
"""
from typing import List
class Solution:
def reconstructQueue(self, people: List[List[int]]) -> List[List[int]]:
if not people:
return []
people.sort(key=lambda x: (-x[0], x[1]))
queue = []
for p in people:
queue.insert(p[1], p)
... | 19.444444 | 126 | 0.506667 |
1aa92aaa121cecd5754a3f5d19472236736f549e | 1,408 | py | Python | tricorder/preprocessing.py | elijahc/tricorder | 1c39dfd1f4b114ee9d67258414a358535b8b129e | [
"MIT"
] | null | null | null | tricorder/preprocessing.py | elijahc/tricorder | 1c39dfd1f4b114ee9d67258414a358535b8b129e | [
"MIT"
] | 4 | 2020-07-18T02:02:09.000Z | 2022-01-25T22:34:37.000Z | tricorder/preprocessing.py | elijahc/tricorder | 1c39dfd1f4b114ee9d67258414a358535b8b129e | [
"MIT"
] | null | null | null | from pyspark.sql import SparkSession
from pyspark.sql.functions import col, lit, collect_list, collect_set
from pyspark.sql.types import StructType, StringType, LongType, IntegerType, FloatType
def preprocess_flowsheet(data_source, output_path):
with SparkSession.builder.appName("preprocess flowsheet").getOrCreat... | 40.228571 | 86 | 0.583807 |
1aa957f0e773ed6f2ff4cb408b3a74ca33120390 | 20,925 | py | Python | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_maintenance_configurations_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_maintenance_configurations_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_maintenance_configurations_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 42.879098 | 247 | 0.67632 |
1aa9841eaa8a1495bff5891a7537174ddd81b79f | 13,664 | py | Python | metalibm_core/core/random_gen.py | nibrunie/metalibm | 776b044f5f323ef907a8724d9ce9a27a482f6cc5 | [
"MIT"
] | 2 | 2019-02-18T13:42:04.000Z | 2021-03-12T18:54:53.000Z | metalibm_core/core/random_gen.py | nibrunie/metalibm | 776b044f5f323ef907a8724d9ce9a27a482f6cc5 | [
"MIT"
] | null | null | null | metalibm_core/core/random_gen.py | nibrunie/metalibm | 776b044f5f323ef907a8724d9ce9a27a482f6cc5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" metalibm_core.core.random_gen Random value generation """
###############################################################################
# This file is part of metalibm (https://github.com/kalray/metalibm)
###############################################################################
# MI... | 37.333333 | 102 | 0.611314 |
1aa99a55228e46796336c5f3b7f16828b1e94e30 | 194 | py | Python | terrascript/stackpath/d.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/stackpath/d.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/stackpath/d.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/stackpath/d.py
# Automatically generated by tools/makecode.py ()
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
| 21.555556 | 79 | 0.768041 |
1aa9f8de80098d02827058d06b37235a08d7e867 | 580 | py | Python | 101. Symmetric Tree.py | Dharaneeshwar/Leetcode | cc3ed07f6ac5f4d6e3f60c57a94a06a8be2f5287 | [
"MIT"
] | 4 | 2020-11-17T05:24:24.000Z | 2021-06-14T21:01:45.000Z | 101. Symmetric Tree.py | Dharaneeshwar/Leetcode | cc3ed07f6ac5f4d6e3f60c57a94a06a8be2f5287 | [
"MIT"
] | null | null | null | 101. Symmetric Tree.py | Dharaneeshwar/Leetcode | cc3ed07f6ac5f4d6e3f60c57a94a06a8be2f5287 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def check(self,r1,r2):
if(r1 is None and r2 is None):
return True
if(r1 is not N... | 34.117647 | 86 | 0.574138 |
1aa9ffe191a5b20ddbf063e40ed5a77c4c9bbddd | 6,440 | py | Python | src/analyzewcsstability.py | LCOGT/lcowcstools | e5db536647dbb143a1f75293ec4f2a4acb68182b | [
"BSD-3-Clause"
] | null | null | null | src/analyzewcsstability.py | LCOGT/lcowcstools | e5db536647dbb143a1f75293ec4f2a4acb68182b | [
"BSD-3-Clause"
] | null | null | null | src/analyzewcsstability.py | LCOGT/lcowcstools | e5db536647dbb143a1f75293ec4f2a4acb68182b | [
"BSD-3-Clause"
] | null | null | null | import argparse
import logging
import matplotlib.pyplot as plt
import numpy as np
import json
import matplotlib.dates as mdates
from wcsfitsdatabase import wcsfitdatabase
__author__ = 'drharbeck@gmail.com'
log = logging.getLogger(__name__)
def dateformat (starttime=None,endtime=None):
""" Utility to prettify a plo... | 31.111111 | 106 | 0.619565 |
1aaa62f19f7d38f6338d6e4f07a6ca7417ea4950 | 4,660 | py | Python | predictionserver/servermixins/linkserver.py | microprediction/predictionserver | 817243a4c85aac63995ab3a18cfbdcb01bb07bd0 | [
"MIT"
] | 1 | 2020-12-04T17:59:19.000Z | 2020-12-04T17:59:19.000Z | predictionserver/servermixins/linkserver.py | microprediction/predictionserver | 817243a4c85aac63995ab3a18cfbdcb01bb07bd0 | [
"MIT"
] | null | null | null | predictionserver/servermixins/linkserver.py | microprediction/predictionserver | 817243a4c85aac63995ab3a18cfbdcb01bb07bd0 | [
"MIT"
] | 1 | 2021-03-05T05:03:36.000Z | 2021-03-05T05:03:36.000Z | from predictionserver.servermixins.baseserver import BaseServer
from predictionserver.servermixins.memoserver import MemoServer
class LinkServer(MemoServer):
# --------------------------------------------------------------------------
# Public interface (linking)
# ---------------------------... | 38.512397 | 89 | 0.576824 |
1aaa738aaa4c8b42a1bfcd7a8dee846b269e717a | 12,992 | py | Python | bittensor/_logging/__init__.py | chaosxcode/bittensor | 9c2f513cc7fb03844952ae3755162ed914b11cba | [
"MIT"
] | null | null | null | bittensor/_logging/__init__.py | chaosxcode/bittensor | 9c2f513cc7fb03844952ae3755162ed914b11cba | [
"MIT"
] | null | null | null | bittensor/_logging/__init__.py | chaosxcode/bittensor | 9c2f513cc7fb03844952ae3755162ed914b11cba | [
"MIT"
] | null | null | null | """ Standardize logging for bittensor
"""
# The MIT License (MIT)
# Copyright © 2021 Yuma Rao
# 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
... | 39.730887 | 257 | 0.603833 |
1aaabbb6aefc564f534c47a529184a713858f26b | 10,446 | py | Python | scripts/preprocess.py | edwardoughton/globalsat | f4d53e94eb54f939a6afa816810ba1ff5bbf83cf | [
"MIT"
] | 6 | 2021-09-07T13:32:28.000Z | 2022-03-30T21:32:17.000Z | scripts/preprocess.py | edwardoughton/globalsat | f4d53e94eb54f939a6afa816810ba1ff5bbf83cf | [
"MIT"
] | null | null | null | scripts/preprocess.py | edwardoughton/globalsat | f4d53e94eb54f939a6afa816810ba1ff5bbf83cf | [
"MIT"
] | null | null | null | """
Process settlement layer
Written by Ed Oughton.
December 2020
"""
import os
import configparser
import json
import math
import glob
import numpy as np
import pandas as pd
import geopandas as gpd
import pyproj
from shapely.geometry import Point, LineString, Polygon, MultiPolygon, shape, mapping, box
from shapely.... | 26.716113 | 93 | 0.645319 |
1aaac349ee0365ca3bb71a490800b0448908da8e | 8,423 | py | Python | milestone_reader/milestone_reader/settings/base.py | IQSS/milestone-reader | 2fc4c0abe3be3e242ca57a1e703cae7ec242bfd4 | [
"MIT"
] | 6 | 2015-01-06T06:55:14.000Z | 2021-05-18T18:12:15.000Z | milestone_reader/milestone_reader/settings/base.py | IQSS/milestone-reader | 2fc4c0abe3be3e242ca57a1e703cae7ec242bfd4 | [
"MIT"
] | 3 | 2015-02-21T19:09:17.000Z | 2015-10-21T13:09:47.000Z | milestone_reader/milestone_reader/settings/base.py | IQSS/milestone-reader | 2fc4c0abe3be3e242ca57a1e703cae7ec242bfd4 | [
"MIT"
] | 1 | 2019-10-26T03:17:49.000Z | 2019-10-26T03:17:49.000Z | """Common settings and globals."""
import json
import os
from os.path import abspath, basename, dirname, join, normpath, isdir, isfile
from sys import path
########## PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
# Absolute filesyste... | 30.629091 | 100 | 0.696545 |
1aaadc90b5defc917a76a1681bee5810aabf8877 | 1,895 | py | Python | venv/Lib/site-packages/pyrogram/raw/base/input_secure_value.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/pyrogram/raw/base/input_secure_value.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/pyrogram/raw/base/input_secure_value.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | 3 | 2022-01-18T11:06:22.000Z | 2022-02-26T13:39:28.000Z | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 37.9 | 96 | 0.644855 |
1aaadee36aac471764af97e72dc5e36da811ba6a | 867 | py | Python | hooks/post_gen_project.py | hdmamin/nbdev_template | ae71868f880a270e22ca2d5fd8ca6c0359259e9c | [
"RSA-MD"
] | null | null | null | hooks/post_gen_project.py | hdmamin/nbdev_template | ae71868f880a270e22ca2d5fd8ca6c0359259e9c | [
"RSA-MD"
] | null | null | null | hooks/post_gen_project.py | hdmamin/nbdev_template | ae71868f880a270e22ca2d5fd8ca6c0359259e9c | [
"RSA-MD"
] | null | null | null | import shutil
import sys
ARGS = {{ cookiecutter }}
def validate_dirname():
dir_name = ARGS['dir_name']
if dir_name != dir_name.lower().replace(' ', ''):
print('Invalid dir name. Remove all spaces and uppercase characters.')
sys.exit(1)
def remove_files():
"""Executes after file structu... | 23.432432 | 78 | 0.620531 |
1aaaf0f6ead9bab793c73b3f01f564d2b13ae010 | 5,899 | py | Python | model/LsCpu.py | keithCollins77093/hardInfo | 17b5031a7ea1aacbe9af30d1f170ffe217420f6e | [
"Apache-2.0"
] | null | null | null | model/LsCpu.py | keithCollins77093/hardInfo | 17b5031a7ea1aacbe9af30d1f170ffe217420f6e | [
"Apache-2.0"
] | null | null | null | model/LsCpu.py | keithCollins77093/hardInfo | 17b5031a7ea1aacbe9af30d1f170ffe217420f6e | [
"Apache-2.0"
] | null | null | null | # Project: hardInfo
# Author: George Keith Watson
# Date Started: March 18, 2022
# Copyright: (c) Copyright 2022 George Keith Watson
# Module: model/LsCpu.py
# Date Started: March 20, 2022
# Purpose: Run Linux commands and collect output into usable Python objects.
#... | 33.327684 | 121 | 0.616037 |
1aaafde0f8d4d448cbfb92099a3803830870ba89 | 34,606 | py | Python | app/hzlbs/peoplestat.py | anningwang/hztxlbs | 58fd2ab240857fcebf8c336a0bbc1fbcf71ae6d0 | [
"BSD-3-Clause"
] | 1 | 2019-02-22T12:33:05.000Z | 2019-02-22T12:33:05.000Z | app/hzlbs/peoplestat.py | anningwang/hztxlbs | 58fd2ab240857fcebf8c336a0bbc1fbcf71ae6d0 | [
"BSD-3-Clause"
] | 3 | 2017-10-16T09:04:33.000Z | 2017-12-27T02:49:04.000Z | app/hzlbs/peoplestat.py | anningwang/hztxlbs | 58fd2ab240857fcebf8c336a0bbc1fbcf71ae6d0 | [
"BSD-3-Clause"
] | 1 | 2017-10-07T16:49:31.000Z | 2017-10-07T16:49:31.000Z | # coding=utf-8
from flask import request, jsonify
from apscheduler.schedulers.background import BackgroundScheduler
import datetime
from app import db, app
from app.models import HzRoomStatCfg, HzRoomStatPoints, HzRoomStatInfo, HzLocation, Jobs
from hzglobal import HZ_BUILDING_ID, HZ_FLOOR_NO
from elecrail import pnp... | 35.89834 | 119 | 0.449922 |
1aab0fa49f8a3bfd902413f08a78a5af695c3275 | 1,873 | py | Python | setup.py | mbertrand/smart_open | d9b9f5ce753be5d6fd7dce578e996f8d56e385aa | [
"MIT"
] | null | null | null | setup.py | mbertrand/smart_open | d9b9f5ce753be5d6fd7dce578e996f8d56e385aa | [
"MIT"
] | null | null | null | setup.py | mbertrand/smart_open | d9b9f5ce753be5d6fd7dce578e996f8d56e385aa | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
import io
import os
from setuptools import setup, find_packages
def read(fname):
return io.open(os.path.join(os.path.... | 24.644737 | 91 | 0.614522 |
1aab42bf308d10be22cde0f1197db900549d8e2e | 954 | py | Python | Chapter 1/01/recipe3.py | robert0714/Python-Testing-Cookbook-Second-Edition | c7c5d59e42e9ca2874faf12a6dd201736a45ca83 | [
"MIT"
] | null | null | null | Chapter 1/01/recipe3.py | robert0714/Python-Testing-Cookbook-Second-Edition | c7c5d59e42e9ca2874faf12a6dd201736a45ca83 | [
"MIT"
] | null | null | null | Chapter 1/01/recipe3.py | robert0714/Python-Testing-Cookbook-Second-Edition | c7c5d59e42e9ca2874faf12a6dd201736a45ca83 | [
"MIT"
] | null | null | null | class RomanNumeralConverter(object):
def __init__(self, roman_numeral):
self.roman_numeral = roman_numeral
self.digit_map = {"M":1000, "D":500, "C":100, "L":50, "X":10, "V":5, "I":1}
def convert_to_decimal(self):
val = 0
for char in self.roman_numeral:
val += self.di... | 34.071429 | 83 | 0.654088 |
1aab610f7b62a5112de3d37808ce0593668ea5e7 | 6,530 | py | Python | python/PythonFCST/mesh/distanceSD.py | jeremyjiezhou/Learn-PyTorch | 7e4404609bacd2ec796f6ca3ea118e8e34ab4a22 | [
"MIT"
] | 24 | 2016-10-04T20:49:55.000Z | 2022-03-12T19:07:10.000Z | python/PythonFCST/mesh/distanceSD.py | jeremyjiezhou/Learn-PyTorch | 7e4404609bacd2ec796f6ca3ea118e8e34ab4a22 | [
"MIT"
] | null | null | null | python/PythonFCST/mesh/distanceSD.py | jeremyjiezhou/Learn-PyTorch | 7e4404609bacd2ec796f6ca3ea118e8e34ab4a22 | [
"MIT"
] | 9 | 2016-12-11T22:15:03.000Z | 2020-11-21T13:51:05.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Mayank Sabharwal
# License: TBD
# Copyright (c) 2012, TBD
import scipy.ndimage as ndimage
import scipy
import numpy as np
import pylab as pl
import scipy.io
from itertools import cycle
class distanceSD:
r"""
Post processor for calcula... | 33.659794 | 112 | 0.580704 |
1aab73a97b8d57589a60b581dbe72f4e0385eaf0 | 637 | py | Python | apps/sushi/migrations/0020_remove_JR5_counter_report.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | apps/sushi/migrations/0020_remove_JR5_counter_report.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | apps/sushi/migrations/0020_remove_JR5_counter_report.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2019-09-20 07:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sushi', '0019_add_defaults_to_sushifetchattempt_booleans'),
]
operations = [
migrations.AlterField(
model_name='counterreporttyp... | 33.526316 | 270 | 0.547881 |
1aac09a8e1183319936672c62d00b5da574b4f62 | 14,577 | py | Python | scripts/04-performance.py | OlafHaag/NeuroPsyResearchAnalysis | 83d750310ee2467979d503d2fb4b6011ead9e9fc | [
"MIT"
] | null | null | null | scripts/04-performance.py | OlafHaag/NeuroPsyResearchAnalysis | 83d750310ee2467979d503d2fb4b6011ead9e9fc | [
"MIT"
] | null | null | null | scripts/04-performance.py | OlafHaag/NeuroPsyResearchAnalysis | 83d750310ee2467979d503d2fb4b6011ead9e9fc | [
"MIT"
] | null | null | null | # notebook source: 04-performance_variables.ipynb
# %% [markdown]
# # Analysis of Performance Variables
#
# ## Task Performance I: Sum of Degrees of Freedom
# The first performance variable is the radius of the white circle, which is the sum of both degrees of freedom. The target is 125.
# %%
# Basic imports and set... | 44.852308 | 131 | 0.597105 |
1aac6eb70488b95b2ea5cdd26e50e76bdc73290d | 1,203 | py | Python | daemon/stores/helper.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | 2 | 2021-06-30T06:56:30.000Z | 2022-03-11T01:27:19.000Z | daemon/stores/helper.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | null | null | null | daemon/stores/helper.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | null | null | null | import os
import uuid
from contextlib import contextmanager
from pathlib import Path
from typing import Union
from daemon import jinad_args
def get_workspace_path(workspace_id: Union[uuid.UUID, str], *args):
"""get the path to the ws
:param workspace_id: the id of the ws
:param args: paths to join
:... | 27.340909 | 120 | 0.679967 |
1aaca0bb05d749ae9bff4964b8095490148c9174 | 21,997 | py | Python | test/unit/rmq_2_sysmon/process_msg.py | mjpernot/rmq-sysmon | 728f696a451b6c870feb22e53be09bfcd7ed3c77 | [
"MIT"
] | null | null | null | test/unit/rmq_2_sysmon/process_msg.py | mjpernot/rmq-sysmon | 728f696a451b6c870feb22e53be09bfcd7ed3c77 | [
"MIT"
] | null | null | null | test/unit/rmq_2_sysmon/process_msg.py | mjpernot/rmq-sysmon | 728f696a451b6c870feb22e53be09bfcd7ed3c77 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Classification (U)
"""Program: process_msg.py
Description: Unit testing of process_msg in rmq_2_sysmon.py.
Usage:
test/unit/rmq_2_sysmon/process_msg.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
if sys.version_info < (2, 7):
impo... | 28.419897 | 79 | 0.615538 |
1aacc23a769c36d124b557ae1f648d7c71fdc3b1 | 25,112 | py | Python | pyquil/tests/test_reference_wavefunction_simulator.py | ecpeterson/pyquil | b0548d5c5f4ee75d4bcd301202a872a9152d212a | [
"Apache-2.0"
] | 1 | 2019-08-15T12:02:23.000Z | 2019-08-15T12:02:23.000Z | pyquil/tests/test_reference_wavefunction_simulator.py | ecpeterson/pyquil | b0548d5c5f4ee75d4bcd301202a872a9152d212a | [
"Apache-2.0"
] | null | null | null | pyquil/tests/test_reference_wavefunction_simulator.py | ecpeterson/pyquil | b0548d5c5f4ee75d4bcd301202a872a9152d212a | [
"Apache-2.0"
] | null | null | null | import functools
import inspect
import random
from math import pi
from operator import mul
import numpy as np
import pytest
from pyquil.api import WavefunctionSimulator
from pyquil.gates import *
from pyquil.paulis import PauliTerm, exponentiate, sZ, sX, sI, sY
from pyquil.pyqvm import PyQVM
from pyquil.quil import P... | 35.977077 | 97 | 0.559693 |
1aacefe8cc8c8731903e2ba14823b565da14da27 | 12,260 | py | Python | src/ftd/tools/prefs.py | FabienTaxil/ftd | a36e0ca59eb60e216a5de1eb93d1089a7f080ec7 | [
"MIT"
] | 3 | 2022-01-26T23:43:16.000Z | 2022-02-11T07:50:49.000Z | src/ftd/tools/prefs.py | lixaft/ftd | a36e0ca59eb60e216a5de1eb93d1089a7f080ec7 | [
"MIT"
] | null | null | null | src/ftd/tools/prefs.py | lixaft/ftd | a36e0ca59eb60e216a5de1eb93d1089a7f080ec7 | [
"MIT"
] | null | null | null | """Maya preferences management based on serialized files."""
import importlib
import json
import logging
import os
import six
import yaml
from maya import cmds
import ftd.ui.utility
LOG = logging.getLogger(__name__)
ENVIRON = os.getenv("FTD_PREFS", None)
"""str: File paths where configuration files can be found.
... | 29.68523 | 79 | 0.576346 |
1aad0087ac8aa1cbeb9ed879d145134ed4128969 | 3,672 | py | Python | packaging/setup/plugins/ovirt-engine-common/base/core/postinstall.py | mu8086/ovirt-engine | 68237f721dff9b2c9e322ad8049dd68ab6a9ccad | [
"Apache-2.0"
] | null | null | null | packaging/setup/plugins/ovirt-engine-common/base/core/postinstall.py | mu8086/ovirt-engine | 68237f721dff9b2c9e322ad8049dd68ab6a9ccad | [
"Apache-2.0"
] | null | null | null | packaging/setup/plugins/ovirt-engine-common/base/core/postinstall.py | mu8086/ovirt-engine | 68237f721dff9b2c9e322ad8049dd68ab6a9ccad | [
"Apache-2.0"
] | null | null | null | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013-2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | 34.971429 | 78 | 0.546841 |
1aad29a5e11ecaa5e26e926b51787cd1f2efd026 | 2,055 | py | Python | scripts/fbOS/coding/MissingNumber.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | null | null | null | scripts/fbOS/coding/MissingNumber.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | 8 | 2020-09-05T16:04:31.000Z | 2022-02-27T09:57:51.000Z | scripts/fbOS/coding/MissingNumber.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | null | null | null | """
Missing Number
Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.
Example 1:
Input: nums = [3,0,1]
Output: 2
Explanation: n = 3 since there are 3 numbers, so all numbers are in the range [0,3]. 2 is the missing number in the... | 27.039474 | 155 | 0.639416 |
1aad2aafcdb3bd030454818d47ff63b645ff7975 | 7,883 | py | Python | detectia/datamodule/dataloader.py | kartik4949/detectia | e62165372b2abac63239d540dfa8c3ee0eafd75c | [
"Apache-2.0"
] | 3 | 2021-02-02T10:59:26.000Z | 2021-11-20T07:56:29.000Z | detectia/datamodule/dataloader.py | kartik4949/detectia | e62165372b2abac63239d540dfa8c3ee0eafd75c | [
"Apache-2.0"
] | null | null | null | detectia/datamodule/dataloader.py | kartik4949/detectia | e62165372b2abac63239d540dfa8c3ee0eafd75c | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Kartik Sharma. 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 law o... | 36.836449 | 87 | 0.622352 |
1aad3bc77cc87385cb2ed19062f6ada0f17f1957 | 260 | py | Python | src/generate_solutions.py | ambimanus/cohda | 99a416fd8ac778d2f2470311f4e21f40426441fc | [
"MIT"
] | 4 | 2016-06-20T09:28:20.000Z | 2020-02-27T09:10:26.000Z | src/generate_solutions.py | dtbinh/cohda | 99a416fd8ac778d2f2470311f4e21f40426441fc | [
"MIT"
] | null | null | null | src/generate_solutions.py | dtbinh/cohda | 99a416fd8ac778d2f2470311f4e21f40426441fc | [
"MIT"
] | 1 | 2019-04-02T09:18:26.000Z | 2019-04-02T09:18:26.000Z | import random
import scenarios
import numpy as np
seed = 0
for h in range(1, 101):
print 'h=%03d' % h
sc = scenarios.SC(random.Random(seed), opt_h=h)
results = scenarios.bruteforce(sc, progress=False)
np.save('bruteforce_h%03d' % h, results)
| 21.666667 | 54 | 0.680769 |
1aad929c39d3007536cef93e611159ac95f3b5e3 | 456 | py | Python | goods/migrations/0026_rfidgoods_count.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | 3 | 2018-10-16T09:36:12.000Z | 2019-04-15T03:12:49.000Z | goods/migrations/0026_rfidgoods_count.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | goods/migrations/0026_rfidgoods_count.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-21 16:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('goods', '0025_auto_20171221_1352'),
]
operations = [
migrations.AddField(
... | 21.714286 | 57 | 0.620614 |
1aad9f12ddb6ac8c72660e284119f89039a4aebe | 46 | py | Python | src/menten_gcn/playground/__init__.py | MentenAI/menten_gcn | bcc7642cb32ab4e60a97687de17c1aa2dc4b5421 | [
"MIT"
] | 11 | 2020-12-15T15:36:47.000Z | 2022-03-10T19:23:36.000Z | src/menten_gcn/playground/__init__.py | MentenAI/menten_gcn | bcc7642cb32ab4e60a97687de17c1aa2dc4b5421 | [
"MIT"
] | 2 | 2021-01-14T15:04:59.000Z | 2021-01-14T19:24:00.000Z | src/menten_gcn/playground/__init__.py | MentenAI/menten_gcn | bcc7642cb32ab4e60a97687de17c1aa2dc4b5421 | [
"MIT"
] | null | null | null | from .nbody_convs import * # noqa: F401,F403
| 23 | 45 | 0.717391 |
1aadbd2b36a472d56cef7e70d827ed4fa0740477 | 5,587 | py | Python | pak/types/misc.py | friedkeenan/pak.py | dd1ff188fa3274e3e329ec436da47c4db97a09d4 | [
"0BSD"
] | 6 | 2021-05-22T21:02:04.000Z | 2022-02-12T01:14:12.000Z | pak/types/misc.py | friedkeenan/pak.py | dd1ff188fa3274e3e329ec436da47c4db97a09d4 | [
"0BSD"
] | null | null | null | pak/types/misc.py | friedkeenan/pak.py | dd1ff188fa3274e3e329ec436da47c4db97a09d4 | [
"0BSD"
] | null | null | null | """Miscellaneous :class:`Types <.Type>`."""
import codecs
import struct
from .. import util
from .type import Type
__all__ = [
"EmptyType",
"Padding",
"RawByte",
"Char",
"StructType",
]
class EmptyType(Type):
"""A :class:`~.Type` of no value.
It always unpacks to ``None`` and always pac... | 21.824219 | 72 | 0.568999 |
1aadc40f65fa3756651374c7dc7bf24ba1325a91 | 916 | py | Python | Chapter25/12.3.py | PacktPublishing/GettingStartedwithPythonfortheInternetofThings- | a5a86ae38b3a4c625dfc1213d32a3f49e1e298c6 | [
"MIT"
] | 19 | 2018-06-28T15:48:47.000Z | 2022-01-08T12:40:52.000Z | Chapter25/12.3.py | PacktPublishing/GettingStartedwithPythonfortheInternetofThings- | a5a86ae38b3a4c625dfc1213d32a3f49e1e298c6 | [
"MIT"
] | null | null | null | Chapter25/12.3.py | PacktPublishing/GettingStartedwithPythonfortheInternetofThings- | a5a86ae38b3a4c625dfc1213d32a3f49e1e298c6 | [
"MIT"
] | 13 | 2018-06-30T10:33:52.000Z | 2021-12-29T11:31:31.000Z | import GPIO library
import RPi.GPIO as GPIO
import time
import Adafruit_ADS1x15
adc0 = Adafruit_ADS1x15.ADS1115()
GAIN = 1
LIGHT = 23
adc0.start_adc(0, gain=GAIN)
adc1.start_adc(1, gain=GAIN)
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
while True:
F_value = adc0.get_last_result()
F1 = (1.0 / (F_valu... | 15.525424 | 43 | 0.575328 |
1aae1cd0f4cddb5235e9bb0c51dae42bc5e906d4 | 800 | py | Python | src/oscar/apps/offer/managers.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | src/oscar/apps/offer/managers.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | src/oscar/apps/offer/managers.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.utils.timezone import now
class ActiveOfferManager(models.Manager):
"""
For searching/creating offers within their date range
"""
def get_queryset(self):
cutoff = now()
return super(ActiveOfferManager, self).get_queryset().filter(
... | 33.333333 | 82 | 0.67 |
1aae603d4c5329bf474d75540ecc8aaf9e78f253 | 237 | py | Python | terrascript/data/joerx/cheesecake.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/data/joerx/cheesecake.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/data/joerx/cheesecake.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/data/joerx/cheesecake.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:13:47 UTC)
import terrascript
class cheesecake_cheesecakes(terrascript.Data):
pass
__all__ = [
"cheesecake_cheesecakes",
]
| 18.230769 | 73 | 0.763713 |
1aae6dabfa8cd3e204325d0ab9daf641cbe890c3 | 1,546 | py | Python | metrics.py | artyompal/google_landmark_2019 | 34effb2771967da0011e546a775cb5ebeebc45ed | [
"Apache-2.0"
] | 10 | 2019-06-05T21:48:03.000Z | 2021-09-17T11:21:45.000Z | metrics.py | artyompal/google_landmark_2019 | 34effb2771967da0011e546a775cb5ebeebc45ed | [
"Apache-2.0"
] | null | null | null | metrics.py | artyompal/google_landmark_2019 | 34effb2771967da0011e546a775cb5ebeebc45ed | [
"Apache-2.0"
] | 5 | 2019-06-06T04:34:52.000Z | 2020-08-26T20:04:54.000Z | ''' Add all the necessary metrics here. '''
import torch
from debug import dprint
def F_score(predict: torch.Tensor, label: torch.Tensor, beta: int,
threshold: float = 0.5) -> torch.Tensor:
predict = predict > threshold
label = label > threshold
TP = (predict & label).sum(1).float()
TN = ... | 29.169811 | 85 | 0.596378 |
1aae7659194b8222e151a736a93bdb9b764d9749 | 2,037 | py | Python | challenge/agoda_cancellation_estimator.py | noamkari/IML.HUJI | 6708f8983dbbcddaba6caf7c759d6a24e0198e96 | [
"MIT"
] | null | null | null | challenge/agoda_cancellation_estimator.py | noamkari/IML.HUJI | 6708f8983dbbcddaba6caf7c759d6a24e0198e96 | [
"MIT"
] | null | null | null | challenge/agoda_cancellation_estimator.py | noamkari/IML.HUJI | 6708f8983dbbcddaba6caf7c759d6a24e0198e96 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import NoReturn
from sklearn.metrics import zero_one_loss
from sklearn.linear_model import LogisticRegression
from IMLearn.base import BaseEstimator
import numpy as np
class AgodaCancellationEstimator(BaseEstimator):
"""
An estimator for solving the Agoda Cancel... | 24.542169 | 77 | 0.576338 |
1aae86b54fc053fc462b8379f68d9012f8a85ea3 | 2,206 | py | Python | vlcp/start.py | hubo1016/vlcp | 61c4c2595b610675ac0cbc4dbc46f70ec40090d3 | [
"Apache-2.0"
] | 252 | 2015-11-17T14:21:50.000Z | 2022-03-11T10:19:47.000Z | vlcp/start.py | SarahZarei/vlcp | 61c4c2595b610675ac0cbc4dbc46f70ec40090d3 | [
"Apache-2.0"
] | 23 | 2018-01-09T13:28:52.000Z | 2019-12-12T06:11:44.000Z | vlcp/start.py | SarahZarei/vlcp | 61c4c2595b610675ac0cbc4dbc46f70ec40090d3 | [
"Apache-2.0"
] | 37 | 2016-08-03T04:42:22.000Z | 2021-12-30T16:57:10.000Z | #env python
'''
Created on 2015/10/19
:author: hubo
Command-line entry
'''
from __future__ import print_function
from vlcp.server import main
import sys
import os.path
# No argparse
import getopt
# Document
doc = '''Run VLCP server from command line
[python|pypy] vlcp.py [-f <configfile>] [-d] [-p <pidfile>] [-F ... | 28.282051 | 104 | 0.570263 |
1aaeb154dc250c87933f66fb23f1a7b25a4ac483 | 11,800 | py | Python | tests/components/mqtt/test_switch.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | tests/components/mqtt/test_switch.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | tests/components/mqtt/test_switch.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """The tests for the MQTT switch platform."""
from asynctest import patch
import pytest
from homeassistant.components import switch
from homeassistant.const import ATTR_ASSUMED_STATE, STATE_OFF, STATE_ON
import homeassistant.core as ha
from homeassistant.setup import async_setup_component
from .test_common import (
... | 31.299735 | 86 | 0.647797 |
1aaebbaea95b08370d6492c5a71071a4d1b6a06e | 1,833 | py | Python | experiments/ashvin/vae/fixed2/reacher2d/test.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/vae/fixed2/reacher2d/test.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/vae/fixed2/reacher2d/test.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | from rlkit.envs.multitask.point2d import MultitaskImagePoint2DEnv
from rlkit.envs.multitask.pusher2d import FullPusher2DEnv
from rlkit.launchers.arglauncher import run_variants
import rlkit.misc.hyperparameter as hyp
from rlkit.torch.vae.vae_experiment import experiment
if __name__ == "__main__":
# noinspection P... | 30.04918 | 73 | 0.60611 |
1aaec1270ae0925d15128c092bc1c7cea5532bda | 166 | py | Python | maths/generic_math_tricks.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | 10 | 2020-09-21T22:23:09.000Z | 2022-01-25T16:58:44.000Z | maths/generic_math_tricks.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | null | null | null | maths/generic_math_tricks.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | null | null | null | # Check for even or odd
a = 3
res = a & 1
if res:
print("odd")
else:
print("even")
# This is the equivalent of dividing by 2
j = 36
print(j >> 1)
| 13.833333 | 42 | 0.554217 |
1aaec8e249e899e2fce0c3381c4a43746f665670 | 13,745 | py | Python | webhook/webhook.py | design4webdev/phen-cogs | bc22ee61c8724eafb4a0317089e52b985ab5c32a | [
"MIT"
] | null | null | null | webhook/webhook.py | design4webdev/phen-cogs | bc22ee61c8724eafb4a0317089e52b985ab5c32a | [
"MIT"
] | null | null | null | webhook/webhook.py | design4webdev/phen-cogs | bc22ee61c8724eafb4a0317089e52b985ab5c32a | [
"MIT"
] | null | null | null | import asyncio
import aiohttp
import discord
from redbot.core import Config, checks, commands
from redbot.core.utils.chat_formatting import humanize_list, pagify
from redbot.core.utils.menus import DEFAULT_CONTROLS, close_menu, menu, start_adding_reactions
from redbot.core.utils.predicates import MessagePredicate, Rea... | 39.84058 | 145 | 0.563987 |
1aaed3bea0131047fcfeca9e73b18c75cabbaee7 | 42 | py | Python | nashvegas/exceptions.py | dcramer/nashvegas | e073e2449700d30940991fd0f5a79d26c76b54d7 | [
"MIT"
] | 2 | 2015-09-24T19:50:55.000Z | 2015-11-06T10:45:08.000Z | nashvegas/exceptions.py | dcramer/nashvegas | e073e2449700d30940991fd0f5a79d26c76b54d7 | [
"MIT"
] | null | null | null | nashvegas/exceptions.py | dcramer/nashvegas | e073e2449700d30940991fd0f5a79d26c76b54d7 | [
"MIT"
] | null | null | null | class MigrationError(Exception):
pass
| 14 | 32 | 0.761905 |
1aaee593df4d8e0fdf3f8a7d8977ae02640dacc3 | 2,309 | py | Python | diesel/util/queue.py | msabramo/diesel | a1ed7ed0358d0fec8592e23aafc3b7ec167ab649 | [
"BSD-3-Clause"
] | 224 | 2015-01-03T06:33:05.000Z | 2021-11-22T03:19:02.000Z | diesel/util/queue.py | dowski/diesel | d9824e467805caf40e0ba21b88a27db38e64c352 | [
"BSD-3-Clause"
] | 12 | 2015-01-01T03:35:15.000Z | 2021-05-22T23:37:28.000Z | diesel/util/queue.py | dowski/diesel | d9824e467805caf40e0ba21b88a27db38e64c352 | [
"BSD-3-Clause"
] | 37 | 2015-01-04T01:47:55.000Z | 2022-03-03T02:04:15.000Z | from uuid import uuid4
import random
from collections import deque
from contextlib import contextmanager
from diesel import fire, sleep, first
from diesel.events import Waiter, StopWaitDispatch
class QueueEmpty(Exception): pass
class QueueTimeout(Exception): pass
class Queue(Waiter):
def __init__(self):
... | 21.990476 | 50 | 0.518839 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.