hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a23c631e3dd2c756a6d94518dd902a850aaee56b | 5,005 | py | Python | data/dataset_implementations/rnn/single_sequence_dataset.py | pdeubel/world-models-testing | 36f2baf79898452e677fe141f11ba434f92e9218 | [
"MIT"
] | null | null | null | data/dataset_implementations/rnn/single_sequence_dataset.py | pdeubel/world-models-testing | 36f2baf79898452e677fe141f11ba434f92e9218 | [
"MIT"
] | null | null | null | data/dataset_implementations/rnn/single_sequence_dataset.py | pdeubel/world-models-testing | 36f2baf79898452e677fe141f11ba434f92e9218 | [
"MIT"
] | null | null | null | import os
import h5py
import numpy as np
import torch
from torch.utils.data import Dataset
| 46.342593 | 119 | 0.710689 | import os
import h5py
import numpy as np
import torch
from torch.utils.data import Dataset
class GUISingleSequenceDataset(Dataset):
def __init__(self, root_dir: str, sequence_length: int, vae_preprocessed_data_path: str, hdf5_data_group_path: str,
actions_transformation_function=None, rewards_t... | 4,658 | 45 | 208 |
fa3a643a8c4d5d570be2001b96c00037782267da | 1,110 | py | Python | release/stubs.min/System/__init___parts/DivideByZeroException.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/__init___parts/DivideByZeroException.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/__init___parts/DivideByZeroException.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class DivideByZeroException(ArithmeticException):
"""
The exception that is thrown when there is an attempt to divide an integral or decimal value by zero.
DivideByZeroException()
DivideByZeroException(message: str)
DivideByZeroException(message: str,innerException: Exception)
"""
def ZZZ(self):
... | 34.6875 | 215 | 0.726126 | class DivideByZeroException(ArithmeticException):
"""
The exception that is thrown when there is an attempt to divide an integral or decimal value by zero.
DivideByZeroException()
DivideByZeroException(message: str)
DivideByZeroException(message: str,innerException: Exception)
"""
def ZZZ(self):
... | 28 | 0 | 48 |
3d85f4be772c1a036395de1aa5c734416e429682 | 11,772 | py | Python | core/tenhou/log.py | SakuraSa/TenhouLoggerX | 7d6bcfb7e22d631673c61321f3af1c05ec011db5 | [
"MIT"
] | 2 | 2016-09-19T16:33:29.000Z | 2017-12-09T01:02:39.000Z | core/tenhou/log.py | SakuraSa/TenhouLoggerX | 7d6bcfb7e22d631673c61321f3af1c05ec011db5 | [
"MIT"
] | null | null | null | core/tenhou/log.py | SakuraSa/TenhouLoggerX | 7d6bcfb7e22d631673c61321f3af1c05ec011db5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
"""
core.tenhou.log
"""
__author__ = 'Rnd495'
import os
import json
import datetime
import urllib
from core.configs import Configs
configs = Configs.instance()
class Log(object):
"""
Log
"""
@property
@property
@property
@property
@propert... | 29.802532 | 116 | 0.569147 | #!/usr/bin/env python
# coding=utf-8
"""
core.tenhou.log
"""
__author__ = 'Rnd495'
import os
import json
import datetime
import urllib
from core.configs import Configs
configs = Configs.instance()
class Log(object):
"""
Log
"""
def __init__(self, ref):
with open(Log.get_file_name(ref), 'r... | 5,939 | 0 | 994 |
b97e642f766dedecd2b8dc7fbaf1c4aba0a274fb | 5,267 | py | Python | tests/parser/features/test_assert.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | 1 | 2021-12-20T16:19:47.000Z | 2021-12-20T16:19:47.000Z | tests/parser/features/test_assert.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | 1 | 2022-03-19T00:45:47.000Z | 2022-03-19T00:45:47.000Z | tests/parser/features/test_assert.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | null | null | null | import pytest
from eth_abi import decode_single
from eth_tester.exceptions import TransactionFailed
# web3 returns f"execution reverted: {err_str}"
# TODO move exception string parsing logic into assert_tx_failed
invalid_code = [
"""
@external
def test(a: int128) -> int128:
assert a > 1, ""
return 1 +... | 25.444444 | 94 | 0.65806 | import pytest
from eth_abi import decode_single
from eth_tester.exceptions import TransactionFailed
# web3 returns f"execution reverted: {err_str}"
# TODO move exception string parsing logic into assert_tx_failed
def _fixup_err_str(s):
return s.replace("execution reverted: ", "")
def test_assert_refund(w3, get_... | 3,906 | 0 | 204 |
3f29ebd88cd6558019edc58f99d89c4d08dc0aae | 8,654 | py | Python | netl2api/l2api/__init__.py | locaweb/netl2api | f84c0362d1676c8771015b7cc48461e44a21c34d | [
"Apache-2.0"
] | 3 | 2015-04-08T18:50:02.000Z | 2019-06-05T22:40:45.000Z | netl2api/l2api/__init__.py | locaweb/netl2api | f84c0362d1676c8771015b7cc48461e44a21c34d | [
"Apache-2.0"
] | null | null | null | netl2api/l2api/__init__.py | locaweb/netl2api | f84c0362d1676c8771015b7cc48461e44a21c34d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8; -*-
#
# 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
#
# Unles... | 40.064815 | 122 | 0.605616 | #!/usr/bin/python
# -*- coding: utf-8; -*-
#
# 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
#
# Unles... | 5,832 | 0 | 837 |
53e3d50dfd8819a70c242ed90be54300221236ee | 12,531 | py | Python | pymeasure/instruments/agilent/agilent8257D.py | dphaas/pymeasure | 580c33bf5f1e409bb575c46bbd1df682bf27cfe1 | [
"MIT"
] | null | null | null | pymeasure/instruments/agilent/agilent8257D.py | dphaas/pymeasure | 580c33bf5f1e409bb575c46bbd1df682bf27cfe1 | [
"MIT"
] | null | null | null | pymeasure/instruments/agilent/agilent8257D.py | dphaas/pymeasure | 580c33bf5f1e409bb575c46bbd1df682bf27cfe1 | [
"MIT"
] | null | null | null | #
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2022 PyMeasure Developers
#
# 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 limit... | 36.533528 | 100 | 0.615194 | #
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2022 PyMeasure Developers
#
# 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 limit... | 356 | 0 | 135 |
dec7d6d3d15ea5d55e90e3e5423d903170fe436f | 12,428 | py | Python | lib/googlecloudsdk/command_lib/storage/resources/s3_resource_reference.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/googlecloudsdk/command_lib/storage/resources/s3_resource_reference.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/command_lib/storage/resources/s3_resource_reference.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. 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 requir... | 38.716511 | 89 | 0.745735 | # -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. 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 requir... | 198 | 0 | 100 |
d66df52d49ff61c5175e83fab8cd02546b04169c | 1,982 | py | Python | apistar_sentry.py | LeadPages/apistar_sentry | f718784b256399ae04f4e8bf82b177f9cc3b1008 | [
"MIT"
] | 2 | 2018-06-10T14:37:04.000Z | 2018-06-16T22:33:46.000Z | apistar_sentry.py | LeadPages/apistar_sentry | f718784b256399ae04f4e8bf82b177f9cc3b1008 | [
"MIT"
] | 3 | 2020-03-24T17:19:55.000Z | 2021-02-02T22:08:44.000Z | apistar_sentry.py | LeadPages/apistar_sentry | f718784b256399ae04f4e8bf82b177f9cc3b1008 | [
"MIT"
] | 1 | 2018-04-16T18:44:33.000Z | 2018-04-16T18:44:33.000Z | import typing
from apistar import Settings
from apistar.interfaces import Auth
from apistar.types import ReturnValue
from raven import Client
__version__ = "0.2.0"
| 26.426667 | 72 | 0.590817 | import typing
from apistar import Settings
from apistar.interfaces import Auth
from apistar.types import ReturnValue
from raven import Client
__version__ = "0.2.0"
class Sentry:
def __init__(self, settings: Settings) -> None:
self.client = Client(
settings["SENTRY_DSN"],
environm... | 1,510 | 184 | 118 |
460ed8df205faa3ecff6b37fb600ecfce371a297 | 7,121 | py | Python | app.py | tanasijevich/project3 | cd4870727e31bad47868625a59a565f4b96d80a5 | [
"MIT"
] | null | null | null | app.py | tanasijevich/project3 | cd4870727e31bad47868625a59a565f4b96d80a5 | [
"MIT"
] | null | null | null | app.py | tanasijevich/project3 | cd4870727e31bad47868625a59a565f4b96d80a5 | [
"MIT"
] | null | null | null | # import necessary libraries
# from models import create_classes
import pandas as pd
import os
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from sqlite3 import connect
import json
from flask import (
Flask,
rend... | 42.136095 | 576 | 0.72869 | # import necessary libraries
# from models import create_classes
import pandas as pd
import os
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from sqlite3 import connect
import json
from flask import (
Flask,
rend... | 4,772 | 0 | 176 |
e202b3b1b0dd6517b189261d661038ca7be2cad9 | 2,377 | py | Python | lambda/extract_yelp/extract.py | Rdbaker/barfinder | 63c75dc99f2371371aa8072078175558d1917864 | [
"BSD-3-Clause"
] | null | null | null | lambda/extract_yelp/extract.py | Rdbaker/barfinder | 63c75dc99f2371371aa8072078175558d1917864 | [
"BSD-3-Clause"
] | null | null | null | lambda/extract_yelp/extract.py | Rdbaker/barfinder | 63c75dc99f2371371aa8072078175558d1917864 | [
"BSD-3-Clause"
] | null | null | null | import logging
from models import tag as Tag, business as Business, business_tag_join_table
logging.getLogger().setLevel(logging.INFO)
def business_exists(yelp_id, conn):
"""Return True if the business exists."""
return conn.execute(Business.select().where(Business.c.yelp_id == yelp_id))\
.first() ... | 32.561644 | 80 | 0.640303 | import logging
from models import tag as Tag, business as Business, business_tag_join_table
logging.getLogger().setLevel(logging.INFO)
def parse_yelp_business(business):
return {
'source': 'yelp',
'raw_yelp_data': business,
'yelp_id': business.get('id'),
'name': business.get('nam... | 1,706 | 0 | 161 |
5ddcfbd5c5a68beee52f20bf25f10cc164269d23 | 14,652 | py | Python | doubling_agent/motility_functions.py | lkmartin90/doubling_agent | 73a7f06aa43c5fa51ea1263b72ebe6f8319bf894 | [
"MIT"
] | 1 | 2020-12-03T15:47:24.000Z | 2020-12-03T15:47:24.000Z | doubling_agent/motility_functions.py | lkmartin90/doubling_agent | 73a7f06aa43c5fa51ea1263b72ebe6f8319bf894 | [
"MIT"
] | null | null | null | doubling_agent/motility_functions.py | lkmartin90/doubling_agent | 73a7f06aa43c5fa51ea1263b72ebe6f8319bf894 | [
"MIT"
] | null | null | null | from random import random
from random import choice
import numpy as np
import plotly.express as px
import struct
import operator
###
# Broadly the same as "basic_functions.py" but updated to include motility
# intentionally trying to keep them separate so as not to slow down the basic version
###
| 36.35732 | 115 | 0.574597 | from random import random
from random import choice
import numpy as np
import plotly.express as px
import struct
import operator
###
# Broadly the same as "basic_functions.py" but updated to include motility
# intentionally trying to keep them separate so as not to slow down the basic version
###
class MotilityParam... | 13,857 | 10 | 469 |
4f5568285363d98aa73edfd78a49dd8dcefd4487 | 2,616 | py | Python | DATA/Ejercicio Pandas/MisMacrosPy.py | JeisonAlarcon/Data_Mining | 265f1ffc202ca1f8b9f6223e95d56bb72e4c8ff3 | [
"MIT"
] | null | null | null | DATA/Ejercicio Pandas/MisMacrosPy.py | JeisonAlarcon/Data_Mining | 265f1ffc202ca1f8b9f6223e95d56bb72e4c8ff3 | [
"MIT"
] | null | null | null | DATA/Ejercicio Pandas/MisMacrosPy.py | JeisonAlarcon/Data_Mining | 265f1ffc202ca1f8b9f6223e95d56bb72e4c8ff3 | [
"MIT"
] | null | null | null | import pandas as pd | 51.294118 | 147 | 0.619266 | import pandas as pd
def onewayfreq(rows,data,weight=None,cum=True,ord="level",subset=None):
if weight is None: weight = 1
else: weight = data[weight]
if subset != None: data = data.query(subset,engine="python")
out = (pd.crosstab(index=data[rows],values=weight,aggfunc="sum",columns="sum").reset_in... | 2,551 | 0 | 46 |
7c713c20032eec8a8f8dbf77f8cd9a9bca904c31 | 1,454 | py | Python | TSP.py | ccfelius/TravelingSalesMan | ebc3b960859590623c0eb301545cd093c41d157a | [
"MIT"
] | 1 | 2020-12-10T17:36:39.000Z | 2020-12-10T17:36:39.000Z | TSP.py | ccfelius/TravelingSalesMan | ebc3b960859590623c0eb301545cd093c41d157a | [
"MIT"
] | null | null | null | TSP.py | ccfelius/TravelingSalesMan | ebc3b960859590623c0eb301545cd093c41d157a | [
"MIT"
] | 1 | 2021-01-05T13:08:07.000Z | 2021-01-05T13:08:07.000Z | """ TSP SIMULATED ANNEALING """
# Imports
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
# read data from file
filename = "eil51.tsp"
f = open(f"TSP-configurations/{filename}.txt", "r")
network = f.readlines()[6:-1]
# create dictionary to store coordinates
nodes = dict()
# split data and pu... | 25.508772 | 209 | 0.636176 | """ TSP SIMULATED ANNEALING """
# Imports
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
# read data from file
filename = "eil51.tsp"
f = open(f"TSP-configurations/{filename}.txt", "r")
network = f.readlines()[6:-1]
# create dictionary to store coordinates
nodes = dict()
# split data and pu... | 0 | 0 | 0 |
161e27c9bae1210d9e0d2d5bf83676988c609bbf | 90,220 | py | Python | tests/Lopez12CPL/test_Lopez12CPL.py | jrlivesey/vplanet | 4384221baa78e81d46b0c0fcb7de2f5a5de2e83c | [
"MIT"
] | null | null | null | tests/Lopez12CPL/test_Lopez12CPL.py | jrlivesey/vplanet | 4384221baa78e81d46b0c0fcb7de2f5a5de2e83c | [
"MIT"
] | null | null | null | tests/Lopez12CPL/test_Lopez12CPL.py | jrlivesey/vplanet | 4384221baa78e81d46b0c0fcb7de2f5a5de2e83c | [
"MIT"
] | null | null | null | import astropy.units as u
import pytest
from benchmark import Benchmark, benchmark
@benchmark(
{
"log.initial.system.Age": {"value": 3.155760e13, "unit": u.sec},
"log.initial.system.Time": {"value": 0.000000, "unit": u.sec},
"log.initial.system.TotAngMom": {
"value": 6.747268e4... | 45.200401 | 88 | 0.496675 | import astropy.units as u
import pytest
from benchmark import Benchmark, benchmark
@benchmark(
{
"log.initial.system.Age": {"value": 3.155760e13, "unit": u.sec},
"log.initial.system.Time": {"value": 0.000000, "unit": u.sec},
"log.initial.system.TotAngMom": {
"value": 6.747268e4... | 0 | 20 | 22 |
35b4a123604f3ad39f518c8cd7cd58c05193a395 | 7,579 | py | Python | common-python/rest_wrappers/oc/oc/upload_storage_object.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 28 | 2016-11-07T14:03:25.000Z | 2022-02-01T08:46:52.000Z | common-python/rest_wrappers/oc/oc/upload_storage_object.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 3 | 2016-11-09T13:23:03.000Z | 2018-04-05T15:49:22.000Z | common-python/rest_wrappers/oc/oc/upload_storage_object.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 13 | 2016-10-27T17:59:38.000Z | 2022-02-18T04:38:38.000Z | #!/usr/bin/python
# Copyright (c) 2013, 2014-2017 Oracle and/or its affiliates. All rights reserved.
"""Provide Module Description
"""
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
__author__ = "Andrew Hopkinson (Oracle Cloud Solutions A-Team)"
__copyright__ = "Copyright (... | 35.919431 | 197 | 0.613933 | #!/usr/bin/python
# Copyright (c) 2013, 2014-2017 Oracle and/or its affiliates. All rights reserved.
"""Provide Module Description
"""
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
__author__ = "Andrew Hopkinson (Oracle Cloud Solutions A-Team)"
__copyright__ = "Copyright (... | 6,118 | 0 | 181 |
70aa394b1e7534f0761f177159418f6363ceeb78 | 14,891 | py | Python | snpy/get_osc.py | emirkmo/snpy | 2a0153c84477ba8a30310d7dbca3d5a8f24de3c6 | [
"MIT"
] | 6 | 2019-01-14T19:40:45.000Z | 2021-06-05T12:19:39.000Z | snpy/get_osc.py | emirkmo/snpy | 2a0153c84477ba8a30310d7dbca3d5a8f24de3c6 | [
"MIT"
] | 3 | 2017-04-25T20:06:22.000Z | 2021-06-09T20:46:41.000Z | snpy/get_osc.py | emirkmo/snpy | 2a0153c84477ba8a30310d7dbca3d5a8f24de3c6 | [
"MIT"
] | 8 | 2017-04-25T19:57:57.000Z | 2021-11-12T11:54:19.000Z | '''
Module for SNooPy to download/parse data from the Open Supernova Catalog.
'''
from __future__ import print_function
import six
import json
if six.PY3:
import urllib.request as urllib
else:
import urllib
from astropy.coordinates import Angle
from snpy import sn,lc,fset
from numpy import array,log10
import ast... | 36.05569 | 92 | 0.555906 | '''
Module for SNooPy to download/parse data from the Open Supernova Catalog.
'''
from __future__ import print_function
import six
import json
if six.PY3:
import urllib.request as urllib
else:
import urllib
from astropy.coordinates import Angle
from snpy import sn,lc,fset
from numpy import array,log10
import ast... | 476 | 0 | 23 |
b838c3e4fd3bce1a2cc716eb2ba8a849168a9356 | 744 | py | Python | Day 15 - OOP/main.py | secureterminal/100-Days-of-Code | 04383ae541938d8a551b5aac9a0dad3348a6ef23 | [
"MIT"
] | 1 | 2022-01-28T13:55:39.000Z | 2022-01-28T13:55:39.000Z | Day 15 - OOP/main.py | secureterminal/100-Days-of-Code | 04383ae541938d8a551b5aac9a0dad3348a6ef23 | [
"MIT"
] | 1 | 2022-02-02T00:13:18.000Z | 2022-02-03T11:32:53.000Z | Day 15 - OOP/main.py | secureterminal/100-Days-of-Code | 04383ae541938d8a551b5aac9a0dad3348a6ef23 | [
"MIT"
] | 2 | 2022-02-07T20:49:36.000Z | 2022-02-19T21:22:15.000Z | from menu import Menu, MenuItem
from coffee_maker import CoffeeMaker
from money_machine import MoneyMachine
money_machine = MoneyMachine()
coffee_maker = CoffeeMaker()
menu = Menu()
coffee_maker.report()
money_machine.report()
coffee_machine_is_on = True
while coffee_machine_is_on:
choices = menu.get_items()
... | 24.8 | 97 | 0.717742 | from menu import Menu, MenuItem
from coffee_maker import CoffeeMaker
from money_machine import MoneyMachine
money_machine = MoneyMachine()
coffee_maker = CoffeeMaker()
menu = Menu()
coffee_maker.report()
money_machine.report()
coffee_machine_is_on = True
while coffee_machine_is_on:
choices = menu.get_items()
... | 0 | 0 | 0 |
fc8a2c85d00bef3bd3bd075b7a046a93e1e9c68c | 4,269 | py | Python | intera_interface/src/intera_interface/digital_io.py | thinclab/intera_sdk | 556de67a88049687404734404e16b147943cde3c | [
"Apache-2.0"
] | 38 | 2017-01-20T15:44:22.000Z | 2022-01-28T15:15:40.000Z | intera_interface/src/intera_interface/digital_io.py | thinclab/intera_sdk | 556de67a88049687404734404e16b147943cde3c | [
"Apache-2.0"
] | 47 | 2016-12-16T19:41:03.000Z | 2022-03-21T14:04:04.000Z | intera_interface/src/intera_interface/digital_io.py | thinclab/intera_sdk | 556de67a88049687404734404e16b147943cde3c | [
"Apache-2.0"
] | 52 | 2017-02-03T13:26:23.000Z | 2021-03-16T14:25:51.000Z | # Copyright (c) 2013-2018, Rethink Robotics Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 29.853147 | 79 | 0.606699 | # Copyright (c) 2013-2018, Rethink Robotics Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 0 | 0 | 0 |
07a2a8bad2c82e238b18e385c8b1b2d9e1a12999 | 2,535 | py | Python | tests/models/mysql_dumps_test.py | ywlianghang/mysql_streamer | 7fc85efaca3db6a387ea4b791632c2df2d04cb3e | [
"Apache-2.0"
] | 419 | 2016-11-17T18:41:47.000Z | 2022-03-14T02:50:02.000Z | tests/models/mysql_dumps_test.py | ywlianghang/mysql_streamer | 7fc85efaca3db6a387ea4b791632c2df2d04cb3e | [
"Apache-2.0"
] | 19 | 2016-11-30T18:09:00.000Z | 2019-04-02T06:20:02.000Z | tests/models/mysql_dumps_test.py | ywlianghang/mysql_streamer | 7fc85efaca3db6a387ea4b791632c2df2d04cb3e | [
"Apache-2.0"
] | 90 | 2016-11-23T06:26:20.000Z | 2022-01-22T09:24:42.000Z | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 28.483146 | 77 | 0.672189 | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 1,533 | 182 | 22 |
0ec5fc82f6363d39869fe20305aa7077435f30d4 | 1,232 | py | Python | WORK/working/crime_vis/crime.py | jessicagtz/WorkingFolder | 4791618e1ec12b9cc38a6ceb1ff03bab1799b0bc | [
"MIT"
] | null | null | null | WORK/working/crime_vis/crime.py | jessicagtz/WorkingFolder | 4791618e1ec12b9cc38a6ceb1ff03bab1799b0bc | [
"MIT"
] | null | null | null | WORK/working/crime_vis/crime.py | jessicagtz/WorkingFolder | 4791618e1ec12b9cc38a6ceb1ff03bab1799b0bc | [
"MIT"
] | 1 | 2018-12-06T21:33:44.000Z | 2018-12-06T21:33:44.000Z | # import dependencies
from flask import Flask, jsonify, render_template, request, redirect
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func, inspect
import pandas as pd
import numpy as np
import datetime as dt
# database setup using au... | 27.377778 | 117 | 0.730519 | # import dependencies
from flask import Flask, jsonify, render_template, request, redirect
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func, inspect
import pandas as pd
import numpy as np
import datetime as dt
# database setup using au... | 421 | 0 | 22 |
60d2134f1b978a5ccd35690d147a761894f25efe | 19,494 | py | Python | easyocr/easyocr.py | ghandic/EasyOCR | f96bea526e7208e4630a18698c18d0223e2a1168 | [
"Apache-2.0"
] | 1 | 2021-07-19T03:17:50.000Z | 2021-07-19T03:17:50.000Z | easyocr/easyocr.py | ghandic/EasyOCR | f96bea526e7208e4630a18698c18d0223e2a1168 | [
"Apache-2.0"
] | null | null | null | easyocr/easyocr.py | ghandic/EasyOCR | f96bea526e7208e4630a18698c18d0223e2a1168 | [
"Apache-2.0"
] | 1 | 2020-10-24T11:40:29.000Z | 2020-10-24T11:40:29.000Z | # -*- coding: utf-8 -*-
import os
import sys
from logging import getLogger
from typing import Any, List, Tuple
import cv2
import numpy as np
import torch
from bidi.algorithm import get_display
from .detection import get_detector, get_textbox
from .imgproc import loadImage
from .recognition import get_recognizer, get... | 46.194313 | 123 | 0.601005 | # -*- coding: utf-8 -*-
import os
import sys
from logging import getLogger
from typing import Any, List, Tuple
import cv2
import numpy as np
import torch
from bidi.algorithm import get_display
from .detection import get_detector, get_textbox
from .imgproc import loadImage
from .recognition import get_recognizer, get... | 13,459 | 5,903 | 23 |
b9ade0befeaaf199c9e1afc1d7f76c7fb111996b | 740 | py | Python | src/proxies/images.py | otanadzetsotne/nn-image-similarity | 8a00c30359e56c4a229942b4b2df6265fa2856a7 | [
"MIT"
] | null | null | null | src/proxies/images.py | otanadzetsotne/nn-image-similarity | 8a00c30359e56c4a229942b4b2df6265fa2856a7 | [
"MIT"
] | null | null | null | src/proxies/images.py | otanadzetsotne/nn-image-similarity | 8a00c30359e56c4a229942b4b2df6265fa2856a7 | [
"MIT"
] | null | null | null | # local
from src.utils.images import ImagesHelper
from src.dtypes import ImagesInner
| 20.555556 | 50 | 0.601351 | # local
from src.utils.images import ImagesHelper
from src.dtypes import ImagesInner
class ProxyImages:
@staticmethod
def filter_correct(
images: ImagesInner,
) -> ImagesInner:
"""
Filter images and return just corrects
"""
return ImagesHelper.filter_correct(im... | 0 | 631 | 23 |
22afb31fa0ba4539038dbf716afbd984f54b90ca | 6,054 | py | Python | code/src/main/python/misconceptions/rUtils/functions.py | DynamicCodeSearch/CodeSeer | ee985ece7691691585952eb88565f0e08bdc9113 | [
"MIT"
] | 5 | 2020-04-05T18:04:13.000Z | 2021-04-13T20:34:19.000Z | code/src/main/python/misconceptions/rUtils/functions.py | DynamicCodeSearch/CodeSeer | ee985ece7691691585952eb88565f0e08bdc9113 | [
"MIT"
] | 1 | 2020-04-29T21:42:26.000Z | 2020-05-01T23:45:45.000Z | code/src/main/python/misconceptions/rUtils/functions.py | DynamicCodeSearch/CodeSeer | ee985ece7691691585952eb88565f0e08bdc9113 | [
"MIT"
] | 3 | 2020-01-27T16:02:14.000Z | 2021-02-08T13:25:15.000Z | import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
__author__ = "bigfatnoob"
import copy
import signal
import time
import re
import rpy2
import rpy2.robjects as robjects
from rpy2 import rinterface
from rpy2.robjects import pandas2ri
from rpy2.robjects.functions import Signatu... | 28.422535 | 107 | 0.743971 | import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
__author__ = "bigfatnoob"
import copy
import signal
import time
import re
import rpy2
import rpy2.robjects as robjects
from rpy2 import rinterface
from rpy2.robjects import pandas2ri
from rpy2.robjects.functions import Signatu... | 4,737 | 0 | 391 |
a65d3f0e19e9c311490bb7bc77d8eea9559cd262 | 339 | py | Python | bot/plugins/joke.py | Preocts/twitch-chat-bot | 50341c30d8eada4b50634c8f25a9eb0eed681735 | [
"MIT"
] | 62 | 2019-11-16T22:07:42.000Z | 2022-03-08T20:50:01.000Z | bot/plugins/joke.py | Preocts/twitch-chat-bot | 50341c30d8eada4b50634c8f25a9eb0eed681735 | [
"MIT"
] | 30 | 2019-03-19T15:05:55.000Z | 2022-03-24T05:00:53.000Z | bot/plugins/joke.py | Preocts/twitch-chat-bot | 50341c30d8eada4b50634c8f25a9eb0eed681735 | [
"MIT"
] | 56 | 2019-06-08T20:34:31.000Z | 2022-02-21T20:10:38.000Z | from __future__ import annotations
from typing import Match
import pyjokes
from bot.config import Config
from bot.data import command
from bot.data import esc
from bot.data import format_msg
@command('!joke', '!yoke')
| 21.1875 | 61 | 0.764012 | from __future__ import annotations
from typing import Match
import pyjokes
from bot.config import Config
from bot.data import command
from bot.data import esc
from bot.data import format_msg
@command('!joke', '!yoke')
async def cmd_joke(config: Config, match: Match[str]) -> str:
return format_msg(match, esc(py... | 94 | 0 | 22 |
b10aa05fe838d0b0b31227f058840a4db0cf7599 | 11,594 | py | Python | ngskit/trim_reads.py | kim-lab/NGSKit | 62f609111ba59b9d7d87dc9979a9a2c57959e297 | [
"MIT"
] | 1 | 2021-12-10T22:23:50.000Z | 2021-12-10T22:23:50.000Z | ngskit/trim_reads.py | kimlaborg/NGSKit | 62f609111ba59b9d7d87dc9979a9a2c57959e297 | [
"MIT"
] | null | null | null | ngskit/trim_reads.py | kimlaborg/NGSKit | 62f609111ba59b9d7d87dc9979a9a2c57959e297 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
import logging
import argparse
import time
import ngskit.barcodes as barcodes
from ngskit.utils import fasta_tools, fastq_tools
#import barcodes
#from utils import fasta_tools, fastq_tools
def trimming(demultiplexed_fastq, barcode, quality_threshold,
trgt_len, ... | 35.894737 | 163 | 0.582456 | #!/usr/bin/env python
import os
import sys
import logging
import argparse
import time
import ngskit.barcodes as barcodes
from ngskit.utils import fasta_tools, fastq_tools
#import barcodes
#from utils import fasta_tools, fastq_tools
def create_folder(output_folder):
# Create output folder
logger = logging.get... | 592 | 0 | 46 |
feade5496f17453a160a194c258f2778a56f8b61 | 75 | py | Python | checkov/yaml_doc/registry.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | checkov/yaml_doc/registry.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | checkov/yaml_doc/registry.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | from checkov.yaml_doc.base_registry import Registry
registry = Registry()
| 18.75 | 51 | 0.826667 | from checkov.yaml_doc.base_registry import Registry
registry = Registry()
| 0 | 0 | 0 |
223e2dd85d17fc5cef76030696a77e0b1f297257 | 497 | py | Python | api/v1/internal.py | anthill-gaming/game_controller | 849ea700263d7724d7a66907e0961956940e6c64 | [
"MIT"
] | null | null | null | api/v1/internal.py | anthill-gaming/game_controller | 849ea700263d7724d7a66907e0961956940e6c64 | [
"MIT"
] | null | null | null | api/v1/internal.py | anthill-gaming/game_controller | 849ea700263d7724d7a66907e0961956940e6c64 | [
"MIT"
] | null | null | null | """
Internal api methods for current service.
Example:
from anthill.platform.api.internal import as_internal, InternalAPI
@as_internal()
async def your_internal_api_method(api: InternalAPI, *params, **options):
# current_service = api.service
...
"""
from anthill.platform.api.internal imp... | 20.708333 | 77 | 0.714286 | """
Internal api methods for current service.
Example:
from anthill.platform.api.internal import as_internal, InternalAPI
@as_internal()
async def your_internal_api_method(api: InternalAPI, *params, **options):
# current_service = api.service
...
"""
from anthill.platform.api.internal imp... | 70 | 0 | 44 |
4842a357559df39c5885b5a0a2d27b724cb94ce7 | 12,748 | py | Python | tf-model-manip.py | PeiqinSun/tf-tutorials | 4d3a9560bce018989e62e9146d63e8fe16eaed91 | [
"Apache-2.0"
] | 184 | 2019-02-25T09:03:30.000Z | 2020-05-20T12:30:00.000Z | tf-model-manip.py | megvii-research/tf-tutorials | 4d3a9560bce018989e62e9146d63e8fe16eaed91 | [
"Apache-2.0"
] | 73 | 2019-02-28T02:51:14.000Z | 2020-04-08T10:48:07.000Z | tf-model-manip.py | PeiqinSun/tf-tutorials | 4d3a9560bce018989e62e9146d63e8fe16eaed91 | [
"Apache-2.0"
] | 103 | 2019-02-28T09:05:21.000Z | 2020-05-18T13:22:10.000Z | #!/usr/bin/env mdl
# -*- coding: utf-8 -*-
# =======================================
# File Name :
# Purpose :
# Creation Date :
# Last Modified :
# Created By : sunpeiqin
# =======================================
import os
import sys
import argparse
import magic
import keyword
import importlib
import collections
impo... | 34.361186 | 122 | 0.547145 | #!/usr/bin/env mdl
# -*- coding: utf-8 -*-
# =======================================
# File Name :
# Purpose :
# Creation Date :
# Last Modified :
# Created By : sunpeiqin
# =======================================
import os
import sys
import argparse
import magic
import keyword
import importlib
import collections
impo... | 8,612 | 260 | 69 |
d607417a565fc6e36134e72eef7edfbbfe35876d | 3,985 | py | Python | preprocessing.py | pedrada88/rwe | a3462556a70bd4a51d2978cadc6101e22723356a | [
"BSD-Source-Code"
] | 15 | 2019-06-05T21:24:42.000Z | 2021-01-04T00:30:29.000Z | preprocessing.py | pedrada88/rwe | a3462556a70bd4a51d2978cadc6101e22723356a | [
"BSD-Source-Code"
] | null | null | null | preprocessing.py | pedrada88/rwe | a3462556a70bd4a51d2978cadc6101e22723356a | [
"BSD-Source-Code"
] | 1 | 2022-01-29T16:23:03.000Z | 2022-01-29T16:23:03.000Z | # -*- coding: utf-8 -*-
import numpy as np
import random
#Load embedding vocabulary
#Load embedding vocabulary
#Load embeddings filtered by pre-given vocabulary
#Load embedding matrices input/output
#Split training and development data
| 38.68932 | 108 | 0.673275 | # -*- coding: utf-8 -*-
import numpy as np
import random
#Load embedding vocabulary
def load_vocab_embeddings(input_path):
first_line=True
vocab=set()
input_file_relations=open(input_file_relations, 'r', encoding='utf-8')
for line in input_file_relations:
if first_line==True:
first_... | 3,633 | 0 | 110 |
eb783e2a63d00549231dcb398c0fd227b6e984a0 | 1,671 | py | Python | cogs/mod_watch.py | MarTCM/ryuko-ng | f28ae5924065096efd72ec5c0d9af895b4310293 | [
"MIT"
] | 11 | 2018-12-23T14:51:20.000Z | 2019-03-03T21:13:26.000Z | cogs/mod_watch.py | MarTCM/ryuko-ng | f28ae5924065096efd72ec5c0d9af895b4310293 | [
"MIT"
] | 47 | 2019-03-11T18:32:05.000Z | 2021-12-08T17:50:38.000Z | cogs/mod_watch.py | MarTCM/ryuko-ng | f28ae5924065096efd72ec5c0d9af895b4310293 | [
"MIT"
] | 26 | 2019-03-11T17:04:05.000Z | 2022-03-08T09:35:38.000Z | import discord
from discord.ext import commands
from discord.ext.commands import Cog
from helpers.checks import check_if_staff
from helpers.userlogs import setwatch
| 35.553191 | 76 | 0.655895 | import discord
from discord.ext import commands
from discord.ext.commands import Cog
from helpers.checks import check_if_staff
from helpers.userlogs import setwatch
class ModWatch(Cog):
def __init__(self, bot):
self.bot = bot
@commands.guild_only()
@commands.check(check_if_staff)
@commands.co... | 51 | 1,407 | 46 |
89b0c8a21bc6d8dd82ceda3dad99a30e2b867960 | 4,219 | py | Python | research/carls/candidate_sampling/candidate_sampler_config_builder_test.py | srihari-humbarwadi/neural-structured-learning | 345b8d644dd7745179263bf6dc9aeb8a921528f4 | [
"Apache-2.0"
] | 939 | 2019-08-28T06:50:30.000Z | 2022-03-30T02:37:07.000Z | research/carls/candidate_sampling/candidate_sampler_config_builder_test.py | srihari-humbarwadi/neural-structured-learning | 345b8d644dd7745179263bf6dc9aeb8a921528f4 | [
"Apache-2.0"
] | 80 | 2019-09-01T19:47:30.000Z | 2022-02-02T20:38:38.000Z | research/carls/candidate_sampling/candidate_sampler_config_builder_test.py | srihari-humbarwadi/neural-structured-learning | 345b8d644dd7745179263bf6dc9aeb8a921528f4 | [
"Apache-2.0"
] | 196 | 2019-09-01T19:38:53.000Z | 2022-02-08T01:25:57.000Z | # Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 34.024194 | 99 | 0.71178 | # Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 3,144 | 37 | 148 |
3089c603282eb0dd2e940a59b5b3d380394bef44 | 4,460 | py | Python | experiments/tuning/tune_came.py | antoineBarbez/Project | 8fa42b5198d03b5b142f413e218b7d7a2d994fc9 | [
"MIT"
] | 4 | 2019-09-30T19:47:42.000Z | 2020-02-13T18:46:32.000Z | experiments/tuning/tune_came.py | antoineBarbez/CAME | 8fa42b5198d03b5b142f413e218b7d7a2d994fc9 | [
"MIT"
] | null | null | null | experiments/tuning/tune_came.py | antoineBarbez/CAME | 8fa42b5198d03b5b142f413e218b7d7a2d994fc9 | [
"MIT"
] | null | null | null | from context import ROOT_DIR, nnUtils, train_came, came
import tensorflow as tf
import numpy as np
import argparse
import os
import progressbar
import random
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
if __name__ == "__main__":
args = parse_args()
data_x, data_y = train_came.build_dataset(train_cam... | 33.533835 | 148 | 0.717937 | from context import ROOT_DIR, nnUtils, train_came, came
import tensorflow as tf
import numpy as np
import argparse
import os
import progressbar
import random
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("antipattern", help="eithe... | 2,067 | 0 | 92 |
183dfb78ccd3bcd30e74ce6de360e7e3b9981c39 | 2,304 | py | Python | tests/test_paginators.py | thesadru/genshin.py | 806b8d0dd059a06605e66dead917fdf550a552bc | [
"MIT"
] | 63 | 2021-10-04T19:53:54.000Z | 2022-03-30T07:21:03.000Z | tests/test_paginators.py | thesadru/genshin.py | 806b8d0dd059a06605e66dead917fdf550a552bc | [
"MIT"
] | 17 | 2021-11-16T20:42:52.000Z | 2022-03-31T10:11:52.000Z | tests/test_paginators.py | thesadru/genshin.py | 806b8d0dd059a06605e66dead917fdf550a552bc | [
"MIT"
] | 10 | 2021-10-16T22:41:41.000Z | 2022-02-19T17:55:23.000Z | import typing
import pytest
from genshin import paginators
@pytest.fixture(name="counting_paginator")
| 28.097561 | 92 | 0.677951 | import typing
import pytest
from genshin import paginators
class CountingPaginator(paginators.Paginator[int]):
_index = 0
async def __anext__(self) -> int:
if self._index >= 5:
self._complete()
self._index += 1
return self._index
@pytest.fixture(name="counting_paginat... | 1,912 | 72 | 206 |
9c0b38982301d37af313b38f7a230a9f3dcabbd3 | 5,190 | py | Python | src/main/python/twitter/thermos/core/muxer.py | isomer/incubator-aurora | 5f54d4de25413bb18acec16120eb18f3e08c6bf0 | [
"Apache-2.0"
] | null | null | null | src/main/python/twitter/thermos/core/muxer.py | isomer/incubator-aurora | 5f54d4de25413bb18acec16120eb18f3e08c6bf0 | [
"Apache-2.0"
] | null | null | null | src/main/python/twitter/thermos/core/muxer.py | isomer/incubator-aurora | 5f54d4de25413bb18acec16120eb18f3e08c6bf0 | [
"Apache-2.0"
] | null | null | null | import os
import errno
from twitter.common import log
from twitter.common.recordio import ThriftRecordReader
from gen.twitter.thermos.ttypes import RunnerCkpt
| 36.293706 | 95 | 0.668015 | import os
import errno
from twitter.common import log
from twitter.common.recordio import ThriftRecordReader
from gen.twitter.thermos.ttypes import RunnerCkpt
class ProcessMuxer(object):
class ProcessExists(Exception): pass
class ProcessNotFound(Exception): pass
class CorruptCheckpoint(Exception): pass
def ... | 2,785 | 2,221 | 23 |
35765a3f52057a1d8c00d42bc632985e8ea22e07 | 4,364 | py | Python | confluent_server/confluent/discovery/handlers/imm.py | brianfinley/confluent | 6458eac93b1e3c6d45e26a7ddb434d692b5cdff2 | [
"Apache-2.0"
] | 27 | 2015-02-11T13:56:46.000Z | 2021-12-28T14:17:20.000Z | confluent_server/confluent/discovery/handlers/imm.py | brianfinley/confluent | 6458eac93b1e3c6d45e26a7ddb434d692b5cdff2 | [
"Apache-2.0"
] | 32 | 2015-09-23T13:19:04.000Z | 2022-03-15T13:50:45.000Z | confluent_server/confluent/discovery/handlers/imm.py | brianfinley/confluent | 6458eac93b1e3c6d45e26a7ddb434d692b5cdff2 | [
"Apache-2.0"
] | 24 | 2015-07-14T20:41:55.000Z | 2021-07-15T04:18:51.000Z | # Copyright 2017 Lenovo
#
# 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, softw... | 38.964286 | 77 | 0.552704 | # Copyright 2017 Lenovo
#
# 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, softw... | 3,440 | 139 | 23 |
c2c0dc95899f6f8dad0a7096d7c04088b895f8b1 | 363 | py | Python | alembic/versions/0367b739bb81_add_country_code_to_table.py | danieliheonu/bigfastapi | 483554776195c9f38bb46ba719b613360eda1028 | [
"MIT"
] | 1 | 2022-03-20T21:46:05.000Z | 2022-03-20T21:46:05.000Z | alembic/versions/0367b739bb81_add_country_code_to_table.py | danieliheonu/bigfastapi | 483554776195c9f38bb46ba719b613360eda1028 | [
"MIT"
] | null | null | null | alembic/versions/0367b739bb81_add_country_code_to_table.py | danieliheonu/bigfastapi | 483554776195c9f38bb46ba719b613360eda1028 | [
"MIT"
] | null | null | null | """add country code to table
Revision ID: 0367b739bb81
Revises: 1e09924c1938
Create Date: 2022-01-27 16:10:57.297020
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0367b739bb81'
down_revision = '1e09924c1938'
branch_labels = None
depends_on = None
| 14.52 | 40 | 0.741047 | """add country code to table
Revision ID: 0367b739bb81
Revises: 1e09924c1938
Create Date: 2022-01-27 16:10:57.297020
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0367b739bb81'
down_revision = '1e09924c1938'
branch_labels = None
depends_on = None
def upgra... | 6 | 0 | 46 |
9c35a421d2475f3566cf629c7b74b3188447fc25 | 152 | py | Python | scripts/visualize_dataset.py | birlrobotics/smach_based_introspection_framework | f16742339cddfc86effba4dbf6e5062304704b89 | [
"BSD-3-Clause"
] | 7 | 2018-02-23T13:02:13.000Z | 2020-07-28T18:27:47.000Z | scripts/visualize_dataset.py | birlrobotics/smach_based_introspection_framework | f16742339cddfc86effba4dbf6e5062304704b89 | [
"BSD-3-Clause"
] | null | null | null | scripts/visualize_dataset.py | birlrobotics/smach_based_introspection_framework | f16742339cddfc86effba4dbf6e5062304704b89 | [
"BSD-3-Clause"
] | 1 | 2019-06-24T09:20:06.000Z | 2019-06-24T09:20:06.000Z | #!/usr/bin/env python
import os
import smach_based_introspection_framework.offline_part.visualize_dataset as m
if __name__ == "__main__":
m.run()
| 19 | 78 | 0.776316 | #!/usr/bin/env python
import os
import smach_based_introspection_framework.offline_part.visualize_dataset as m
if __name__ == "__main__":
m.run()
| 0 | 0 | 0 |
489726ea2da03626c5a2318798d31acaac09e9b1 | 12,261 | py | Python | packages/weevely/modules/net/proxy.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | packages/weevely/modules/net/proxy.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | packages/weevely/modules/net/proxy.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | from core.loggers import log, dlog
from core import messages
from core.vectors import ModuleExec
from core.module import Module
from core.config import base_path
from http.server import HTTPServer, BaseHTTPRequestHandler
from tempfile import gettempdir
from socketserver import ThreadingMixIn
from urllib.parse import ur... | 32.350923 | 119 | 0.575402 | from core.loggers import log, dlog
from core import messages
from core.vectors import ModuleExec
from core.module import Module
from core.config import base_path
from http.server import HTTPServer, BaseHTTPRequestHandler
from tempfile import gettempdir
from socketserver import ThreadingMixIn
from urllib.parse import ur... | 9,893 | 686 | 245 |
c1a9fb6d2776eae6bdea4a9ec9110150e80c3b44 | 65 | py | Python | or_testbed/solvers/grasp/__init__.py | Fynardo/or-testbed | 9cc58edd71f400da7a933f166cd325e43562cfb6 | [
"MIT"
] | 1 | 2020-07-23T14:59:03.000Z | 2020-07-23T14:59:03.000Z | or_testbed/solvers/grasp/__init__.py | Fynardo/or-testbed | 9cc58edd71f400da7a933f166cd325e43562cfb6 | [
"MIT"
] | null | null | null | or_testbed/solvers/grasp/__init__.py | Fynardo/or-testbed | 9cc58edd71f400da7a933f166cd325e43562cfb6 | [
"MIT"
] | null | null | null | from .construct import GraspConstruct, MultiStartGraspConstruct
| 32.5 | 64 | 0.876923 | from .construct import GraspConstruct, MultiStartGraspConstruct
| 0 | 0 | 0 |
30c3599ff9f4efeffbeca8fb7c06634e903655c8 | 1,151 | py | Python | tsengine/test/test_pool.py | ccccxjin/TsEngine | 5f8deed436eb9756be40f78a7bf52be9e910b501 | [
"MIT"
] | 1 | 2020-07-10T09:11:38.000Z | 2020-07-10T09:11:38.000Z | tsengine/test/test_pool.py | ccccxjin/tsengine | 5f8deed436eb9756be40f78a7bf52be9e910b501 | [
"MIT"
] | null | null | null | tsengine/test/test_pool.py | ccccxjin/tsengine | 5f8deed436eb9756be40f78a7bf52be9e910b501 | [
"MIT"
] | null | null | null | import pytest
| 27.404762 | 54 | 0.578627 | import pytest
class TestPool:
def test_pool_get(self, pool):
assert pool.checkedin == 1
assert pool.checkedout == 0
connection1 = pool.get()
assert pool.checkedin == 0
assert pool.checkedout == 1
connection2 = pool.get()
assert pool.checkedin == 0
as... | 1,093 | -6 | 49 |
e5d6df24af9bac17d018ee4f885d2b0a7d316e52 | 4,965 | py | Python | course_grader/views/api/submitted_graderoster.py | uw-it-aca/gradepage | 7059d715cc112ad0ecb0e5012f716e525ee7b3bc | [
"Apache-2.0"
] | 1 | 2017-01-29T09:52:06.000Z | 2017-01-29T09:52:06.000Z | course_grader/views/api/submitted_graderoster.py | uw-it-aca/gradepage | 7059d715cc112ad0ecb0e5012f716e525ee7b3bc | [
"Apache-2.0"
] | 287 | 2017-03-09T00:17:20.000Z | 2022-01-08T00:36:34.000Z | course_grader/views/api/submitted_graderoster.py | uw-it-aca/gradepage | 7059d715cc112ad0ecb0e5012f716e525ee7b3bc | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.conf import settings
from django.http import HttpResponse
from django.views.decorators.cache import never_cache
from django.utils.decorators import method_decorator
from uw_saml.decorators import group_required
from cour... | 35.978261 | 76 | 0.627593 | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.conf import settings
from django.http import HttpResponse
from django.views.decorators.cache import never_cache
from django.utils.decorators import method_decorator
from uw_saml.decorators import group_required
from cour... | 3,738 | 37 | 96 |
72cac8fb30a2e307bde5d70d65c30b41c1787dec | 1,235 | py | Python | pipeline/boto_helpers.py | DMS-medical-informatics/beiwe-backend | 55afe3a16e1c9b34501f3655288b5c19c663a083 | [
"BSD-3-Clause"
] | null | null | null | pipeline/boto_helpers.py | DMS-medical-informatics/beiwe-backend | 55afe3a16e1c9b34501f3655288b5c19c663a083 | [
"BSD-3-Clause"
] | null | null | null | pipeline/boto_helpers.py | DMS-medical-informatics/beiwe-backend | 55afe3a16e1c9b34501f3655288b5c19c663a083 | [
"BSD-3-Clause"
] | null | null | null | import json
import os.path
import subprocess
import boto3
# This is all cribbed from the django branch's cluster_management/deployment_helpers folder
# TODO once the branches are merged, use that code and NOT this code
| 29.404762 | 99 | 0.728745 | import json
import os.path
import subprocess
import boto3
# This is all cribbed from the django branch's cluster_management/deployment_helpers folder
# TODO once the branches are merged, use that code and NOT this code
def get_aws_object_names():
configs_folder = get_configs_folder()
with open(o... | 871 | 0 | 125 |
e5e52448863aa3d2032ea0acf739006c4aeffca6 | 1,783 | py | Python | WaltzControl/use_cases/tel_controller_boundarys.py | DaneSpaeth/WaltzControl_refactored | 80aa3e28f1e0709bc7dd9472bc1d841e9b4da9e7 | [
"MIT"
] | null | null | null | WaltzControl/use_cases/tel_controller_boundarys.py | DaneSpaeth/WaltzControl_refactored | 80aa3e28f1e0709bc7dd9472bc1d841e9b4da9e7 | [
"MIT"
] | null | null | null | WaltzControl/use_cases/tel_controller_boundarys.py | DaneSpaeth/WaltzControl_refactored | 80aa3e28f1e0709bc7dd9472bc1d841e9b4da9e7 | [
"MIT"
] | null | null | null | """Boundarys for Responses from TelescopeController (TC) and Requests to TC.
Data entry and exit point into use_cases layer.
"""
class TelescopeControllerResponseBoundary:
"""Contains Responses from TelescopeController Device.
"""
def __init__(
self,
ra_response = None,
dec_respo... | 28.758065 | 80 | 0.574313 | """Boundarys for Responses from TelescopeController (TC) and Requests to TC.
Data entry and exit point into use_cases layer.
"""
class TelescopeControllerResponseBoundary:
"""Contains Responses from TelescopeController Device.
"""
def __init__(
self,
ra_response = None,
dec_respo... | 30 | 0 | 61 |
2992c83e0ce52d8039899799790c8ae2a72523fc | 3,505 | py | Python | example_group_epochs.py | DraganaMana/mne_microstates | de3dc76e63e49fb4b61810bf737d4d5d11f5b2f0 | [
"MIT"
] | 1 | 2021-06-02T09:14:30.000Z | 2021-06-02T09:14:30.000Z | example_group_epochs.py | DraganaMana/mne_microstates | de3dc76e63e49fb4b61810bf737d4d5d11f5b2f0 | [
"MIT"
] | null | null | null | example_group_epochs.py | DraganaMana/mne_microstates | de3dc76e63e49fb4b61810bf737d4d5d11f5b2f0 | [
"MIT"
] | 1 | 2020-06-15T13:59:07.000Z | 2020-06-15T13:59:07.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 25 18:04:32 2020
@author: Dragana
"""
import mne
import microstates as mst
import numpy as np
HC_RS_path = 'C:/Users/.../Documents/RS_EEG/'
subj_folder = ['subj01', 'subj02', 'subj03', 'subj04', 'subj05']
# Parameteres setting up
chan_to_drop = ['E67', 'E73', 'E247'... | 36.510417 | 87 | 0.628531 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 25 18:04:32 2020
@author: Dragana
"""
import mne
import microstates as mst
import numpy as np
HC_RS_path = 'C:/Users/.../Documents/RS_EEG/'
subj_folder = ['subj01', 'subj02', 'subj03', 'subj04', 'subj05']
# Parameteres setting up
chan_to_drop = ['E67', 'E73', 'E247'... | 0 | 0 | 0 |
d0c633f50b464b8e08988638cf34cd0815c70e55 | 1,142 | py | Python | chunkymonkey/lib/base.py | shopzilla/chunky-monkey | 2556055e87849e2a873a950a5e52429e516c8304 | [
"Apache-2.0"
] | 1 | 2016-10-24T15:16:26.000Z | 2016-10-24T15:16:26.000Z | chunkymonkey/lib/base.py | shopzilla/chunky-monkey | 2556055e87849e2a873a950a5e52429e516c8304 | [
"Apache-2.0"
] | null | null | null | chunkymonkey/lib/base.py | shopzilla/chunky-monkey | 2556055e87849e2a873a950a5e52429e516c8304 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2011 Shopzilla.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this 1 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... | 36.83871 | 74 | 0.75394 | #
# Copyright 2011 Shopzilla.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this 1 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... | 0 | 359 | 23 |
7d5cf31371d57d1d5e01bffec3ad52101c96988a | 134,221 | py | Python | carculator/inventory.py | SimonVoelker/carculator | e40d664c9b5612250cf9ad2c6fa2a199b0bf88c5 | [
"BSD-3-Clause"
] | null | null | null | carculator/inventory.py | SimonVoelker/carculator | e40d664c9b5612250cf9ad2c6fa2a199b0bf88c5 | [
"BSD-3-Clause"
] | null | null | null | carculator/inventory.py | SimonVoelker/carculator | e40d664c9b5612250cf9ad2c6fa2a199b0bf88c5 | [
"BSD-3-Clause"
] | null | null | null | from . import DATA_DIR
import sys
import glob
from .background_systems import BackgroundSystemModel
from .export import ExportInventory
from inspect import currentframe, getframeinfo
from pathlib import Path
from scipy import sparse
import csv
import itertools
import numexpr as ne
import numpy as np
import xarray as xr... | 36.793037 | 150 | 0.42471 | from . import DATA_DIR
import sys
import glob
from .background_systems import BackgroundSystemModel
from .export import ExportInventory
from inspect import currentframe, getframeinfo
from pathlib import Path
from scipy import sparse
import csv
import itertools
import numexpr as ne
import numpy as np
import xarray as xr... | 30,672 | 0 | 189 |
544162d5b108b9011d584715752e360c5e3a3bf6 | 4,955 | py | Python | project/project/settings.py | gtrafimenkov/example-django-kubernetes | ddcf1d0b06152ca3615230be53cf9a5f837c09d9 | [
"BSD-3-Clause"
] | null | null | null | project/project/settings.py | gtrafimenkov/example-django-kubernetes | ddcf1d0b06152ca3615230be53cf9a5f837c09d9 | [
"BSD-3-Clause"
] | 6 | 2021-02-02T22:59:52.000Z | 2021-06-10T20:35:55.000Z | project/project/settings.py | gtrafimenkov/example-django-kubernetes | ddcf1d0b06152ca3615230be53cf9a5f837c09d9 | [
"BSD-3-Clause"
] | null | null | null | # Django settings for gtd project.
import os
from django.contrib.messages import constants as message_constants
DEBUG = get_debug_settings()
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_na... | 32.81457 | 101 | 0.638143 | # Django settings for gtd project.
import os
from django.contrib.messages import constants as message_constants
def get_debug_settings():
return os.environ.get("DJANGO_DEBUG", "").lower() in ["true", "1", "yes", "y"]
DEBUG = get_debug_settings()
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Local tim... | 975 | 0 | 46 |
1f010d3368e8fe21a4c6b38d8a3a7ce2c8c7822f | 964 | py | Python | resources/search.py | DanielNery/api-list-mscs-genius | 9febbbb4211ca86a210803981cb5968077d7de72 | [
"MIT"
] | 1 | 2021-11-20T22:09:23.000Z | 2021-11-20T22:09:23.000Z | resources/search.py | DanielNery/api-list-mscs-genius | 9febbbb4211ca86a210803981cb5968077d7de72 | [
"MIT"
] | null | null | null | resources/search.py | DanielNery/api-list-mscs-genius | 9febbbb4211ca86a210803981cb5968077d7de72 | [
"MIT"
] | null | null | null | from flask_restful import Resource
import requests
import json
import os
import redis
HEADER = {
'User-Agent': 'CompuServe Classic/1.22',
'Accept': 'application/json',
'Host': os.getenv("HOST"),
'Authorization': f'Bearer {os.getenv("ACESS_TOKEN")}'
}
class Search(Resource):
"""Recurso responsáve... | 25.368421 | 85 | 0.607884 | from flask_restful import Resource
import requests
import json
import os
import redis
HEADER = {
'User-Agent': 'CompuServe Classic/1.22',
'Accept': 'application/json',
'Host': os.getenv("HOST"),
'Authorization': f'Bearer {os.getenv("ACESS_TOKEN")}'
}
class Search(Resource):
"""Recurso responsáve... | 0 | 0 | 0 |
7baca6067411cc1ecfa07468272839cd744972f8 | 441 | py | Python | string/firstUniqueCharacterInAString.py | G-MontaG/leetcode | 444e8ee3f395c191a86eae0e42d028060ecd1686 | [
"MIT"
] | 1 | 2021-02-10T18:14:55.000Z | 2021-02-10T18:14:55.000Z | string/firstUniqueCharacterInAString.py | G-MontaG/leetcode | 444e8ee3f395c191a86eae0e42d028060ecd1686 | [
"MIT"
] | null | null | null | string/firstUniqueCharacterInAString.py | G-MontaG/leetcode | 444e8ee3f395c191a86eae0e42d028060ecd1686 | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/first-unique-character-in-a-string/
| 27.5625 | 67 | 0.519274 | # https://leetcode.com/problems/first-unique-character-in-a-string/
class Solution:
def firstUniqChar(self, s: str) -> int:
mapping = {}
for index, char in enumerate(s):
if char in mapping.keys():
mapping[char] = -1
else:
mapping[char] = index
... | 331 | -6 | 48 |
0cc5410e4e819af67fb7073f0bb5d856a89be207 | 453 | py | Python | ktapp/migrations/0037_ktuser_fav_period.py | cu2/KT | 8a0964b77dce150358637faa679d969a07e42f07 | [
"CC-BY-3.0"
] | 5 | 2015-04-13T09:44:31.000Z | 2017-10-19T01:07:58.000Z | ktapp/migrations/0037_ktuser_fav_period.py | cu2/KT | 8a0964b77dce150358637faa679d969a07e42f07 | [
"CC-BY-3.0"
] | 49 | 2015-02-15T07:12:05.000Z | 2022-03-11T23:11:43.000Z | ktapp/migrations/0037_ktuser_fav_period.py | cu2/KT | 8a0964b77dce150358637faa679d969a07e42f07 | [
"CC-BY-3.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| 21.571429 | 74 | 0.602649 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ktapp', '0036_ktuser_bio'),
]
operations = [
migrations.AddField(
model_name='ktuser',
name='fav_per... | 0 | 323 | 23 |
45ca169aee71ee56ada82a211aa1e50134aad821 | 2,133 | py | Python | mmtrack/datasets/youtube_vis_dataset.py | benxiao/mmtracking | 4363a05659d5f26da97b9725075dcbb3b13f775f | [
"Apache-2.0"
] | 1 | 2022-03-12T21:36:42.000Z | 2022-03-12T21:36:42.000Z | mmtrack/datasets/youtube_vis_dataset.py | Readpistol/mmtracking | 131b8fb7c632324f88c3240229e411e801380f2a | [
"Apache-2.0"
] | null | null | null | mmtrack/datasets/youtube_vis_dataset.py | Readpistol/mmtracking | 131b8fb7c632324f88c3240229e411e801380f2a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from mmdet.datasets import DATASETS
from .coco_video_dataset import CocoVideoDataset
@DATASETS.register_module()
class YouTubeVISDataset(CocoVideoDataset):
"""YouTube VIS dataset for video instance segmentation."""
CLASSES_2019_version = ('person', 'giant_pand... | 48.477273 | 79 | 0.506329 | # Copyright (c) OpenMMLab. All rights reserved.
from mmdet.datasets import DATASETS
from .coco_video_dataset import CocoVideoDataset
@DATASETS.register_module()
class YouTubeVISDataset(CocoVideoDataset):
"""YouTube VIS dataset for video instance segmentation."""
CLASSES_2019_version = ('person', 'giant_pand... | 485 | 0 | 53 |
b26e7b4e1b789021e57269548d99674e7d9e0fb6 | 2,198 | py | Python | easyDiffractionApp/Logic/DisplayModels/StatusModel.py | rozyczko/easyDiffractionApp | 6b088e3cb19f943e6eee0e86c3c23515b7c6a084 | [
"BSD-3-Clause"
] | 1 | 2021-05-25T15:26:44.000Z | 2021-05-25T15:26:44.000Z | easyDiffractionApp/Logic/DisplayModels/StatusModel.py | rozyczko/easyDiffractionApp | 6b088e3cb19f943e6eee0e86c3c23515b7c6a084 | [
"BSD-3-Clause"
] | 138 | 2021-02-12T07:59:04.000Z | 2022-03-26T12:07:19.000Z | easyDiffractionApp/Logic/DisplayModels/StatusModel.py | rozyczko/easyDiffractionApp | 6b088e3cb19f943e6eee0e86c3c23515b7c6a084 | [
"BSD-3-Clause"
] | 3 | 2021-05-07T07:08:25.000Z | 2021-11-02T09:53:26.000Z | # SPDX-FileCopyrightText: 2021 easyDiffraction contributors <support@easydiffraction.org>
# SPDX-License-Identifier: BSD-3-Clause
# © 2021 Contributors to the easyDiffraction project <https://github.com/easyScience/easyDiffractionApp>
__author__ = 'github.com/andrewsazonov'
__version__ = '0.0.1'
from random import ra... | 27.475 | 104 | 0.641492 | # SPDX-FileCopyrightText: 2021 easyDiffraction contributors <support@easydiffraction.org>
# SPDX-License-Identifier: BSD-3-Clause
# © 2021 Contributors to the easyDiffraction project <https://github.com/easyScience/easyDiffractionApp>
__author__ = 'github.com/andrewsazonov'
__version__ = '0.0.1'
from random import ra... | 118 | 1,633 | 46 |
41c794a5523ae6175185d6430eee0502fa65573d | 1,349 | py | Python | run.py | iustce/cesa-web | 8b6b1fd8a66277b7319fdbf327e19948cc56917d | [
"MIT"
] | 1 | 2018-10-13T19:48:05.000Z | 2018-10-13T19:48:05.000Z | run.py | iustce/cesa-web | 8b6b1fd8a66277b7319fdbf327e19948cc56917d | [
"MIT"
] | null | null | null | run.py | iustce/cesa-web | 8b6b1fd8a66277b7319fdbf327e19948cc56917d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# python imports
import os
import subprocess
import sys, traceback
from flask.ext.migrate import MigrateCommand
from flask.ext.script import Manager
from database import manager as database_manager
try:
from project import app
from project.application import configure_app
from proj... | 24.981481 | 111 | 0.731653 | # -*- coding: utf-8 -*-
# python imports
import os
import subprocess
import sys, traceback
from flask.ext.migrate import MigrateCommand
from flask.ext.script import Manager
from database import manager as database_manager
try:
from project import app
from project.application import configure_app
from proj... | 386 | 0 | 88 |
3622ebf53eb605a0ad50e3ba80cbe1fe001d8264 | 11,174 | py | Python | docs/model.py | DLR-SC/gitlab2prov | 0a548cf85121faa63ef9abbbf0d43aa4e0bc3d57 | [
"MIT"
] | 13 | 2019-10-14T19:28:04.000Z | 2022-03-24T09:46:50.000Z | docs/model.py | DLR-SC/gitlab2prov | 0a548cf85121faa63ef9abbbf0d43aa4e0bc3d57 | [
"MIT"
] | 50 | 2019-10-15T09:05:09.000Z | 2022-03-28T10:51:22.000Z | docs/model.py | DLR-SC/gitlab2prov | 0a548cf85121faa63ef9abbbf0d43aa4e0bc3d57 | [
"MIT"
] | 2 | 2020-05-16T15:40:04.000Z | 2021-09-14T12:08:19.000Z | """PROV model fpr GitLab2PROV."""
__author__ = "Claas de Boer, Andreas Schreiber, Lynn von Kurnatowski"
__copyright__ = "Copyright 2020, German Aerospace Center (DLR) and individual contributors"
__license__ = "MIT"
__version__ = "0.5"
__status__ = "Development"
from prov.model import ProvDocument
from prov.constant... | 61.060109 | 264 | 0.707625 | """PROV model fpr GitLab2PROV."""
__author__ = "Claas de Boer, Andreas Schreiber, Lynn von Kurnatowski"
__copyright__ = "Copyright 2020, German Aerospace Center (DLR) and individual contributors"
__license__ = "MIT"
__version__ = "0.5"
__status__ = "Development"
from prov.model import ProvDocument
from prov.constant... | 0 | 0 | 0 |
f495910cbad974850a149f592f1022624205f1c7 | 9,479 | py | Python | scripts/go_stats_utils.py | kltm/go-site | fe6797ed1291bd0d12df83b7c9d670c91a0fb526 | [
"BSD-3-Clause"
] | 31 | 2016-11-01T13:11:43.000Z | 2022-02-28T05:05:16.000Z | scripts/go_stats_utils.py | kltm/go-site | fe6797ed1291bd0d12df83b7c9d670c91a0fb526 | [
"BSD-3-Clause"
] | 1,172 | 2015-01-29T23:47:53.000Z | 2022-03-30T05:22:01.000Z | scripts/go_stats_utils.py | kltm/go-site | fe6797ed1291bd0d12df83b7c9d670c91a0fb526 | [
"BSD-3-Clause"
] | 92 | 2015-02-11T03:10:55.000Z | 2022-03-01T08:16:02.000Z | import json
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
from enum import Enum
# This is a hard coded list of evidence, better organized for readability
ev_all = ['EXP', 'IDA', 'IMP', 'IGI', 'IPI', 'IEP', 'IGC', 'RCA', 'IBA', 'IKR', 'IC', 'NAS', 'ND', 'TAS', 'HDA', 'H... | 31.387417 | 169 | 0.606815 | import json
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
from enum import Enum
# This is a hard coded list of evidence, better organized for readability
ev_all = ['EXP', 'IDA', 'IMP', 'IGI', 'IPI', 'IEP', 'IGC', 'RCA', 'IBA', 'IKR', 'IC', 'NAS', 'ND', 'TAS', 'HDA', 'H... | 5,663 | 101 | 517 |
5fcb1e0039071dfe15f9923cb83138fdd37d3701 | 774 | py | Python | tests/mixins/urls_mixin.py | Nyior/django-rest-paystack | fd74dd26703fe4ce63664736c2063ace7020f71a | [
"MIT"
] | 9 | 2021-12-12T17:59:15.000Z | 2022-02-05T17:13:46.000Z | tests/mixins/urls_mixin.py | Nyior/django-rest-paystack | fd74dd26703fe4ce63664736c2063ace7020f71a | [
"MIT"
] | null | null | null | tests/mixins/urls_mixin.py | Nyior/django-rest-paystack | fd74dd26703fe4ce63664736c2063ace7020f71a | [
"MIT"
] | 1 | 2021-12-21T18:57:03.000Z | 2021-12-21T18:57:03.000Z | from django.urls import reverse
| 27.642857 | 78 | 0.706718 | from django.urls import reverse
class URLsMixin(object):
def initiate_transaction_url(self):
return reverse("transaction-initiate")
def verify_transaction_url(self, trans_ref):
return reverse("transaction-verify") + f"?transaction_ref={trans_ref}"
def charge_customer_url(self):
r... | 500 | 3 | 238 |
841c91691e5e3f9f8e364f9c80db23924bcbaafd | 102 | py | Python | notebooks/exercise_solutions/n00_python_intro_data-structures.py | pydy/pydy-tutorial-human-standing | 72b1d8513e339e9b10e501bd3490caa3fa997bc4 | [
"CC-BY-4.0"
] | 134 | 2015-05-19T15:24:18.000Z | 2022-03-12T09:39:03.000Z | notebooks/exercise_solutions/n00_python_intro_data-structures.py | pydy/pydy-tutorial-human-standing | 72b1d8513e339e9b10e501bd3490caa3fa997bc4 | [
"CC-BY-4.0"
] | 46 | 2015-05-05T18:08:20.000Z | 2022-01-28T11:12:42.000Z | notebooks/exercise_solutions/n00_python_intro_data-structures.py | pydy/pydy-tutorial-pycon-2014 | 72b1d8513e339e9b10e501bd3490caa3fa997bc4 | [
"CC-BY-4.0"
] | 62 | 2015-06-16T01:50:51.000Z | 2022-02-26T07:39:41.000Z | num_list = [1,2,3,4]
months = ['Jan', 'Feb', 'Mar', 'Apr']
months_dict = dict(zip(months, num_list)) | 20.4 | 41 | 0.607843 | num_list = [1,2,3,4]
months = ['Jan', 'Feb', 'Mar', 'Apr']
months_dict = dict(zip(months, num_list)) | 0 | 0 | 0 |
fe92b53f5b3777d23e5c45c05e94c9a44f57b7aa | 345 | py | Python | calingen/interfaces/__init__.py | Mischback/django-calingen | 3354c751e29d301609ec44e64d69a8729ec36de4 | [
"MIT"
] | null | null | null | calingen/interfaces/__init__.py | Mischback/django-calingen | 3354c751e29d301609ec44e64d69a8729ec36de4 | [
"MIT"
] | 51 | 2021-11-15T20:44:19.000Z | 2022-02-10T08:33:08.000Z | calingen/interfaces/__init__.py | Mischback/django-calingen | 3354c751e29d301609ec44e64d69a8729ec36de4 | [
"MIT"
] | null | null | null | # SPDX-License-Identifier: MIT
"""The application's interfaces that are used to connect the different components.
Notes
-----
This package's code is not really specific to the Django framework. It is an
abstraction layer.
Primary focus is the provision of a plugin API, that allows the app to be
extendable with third... | 26.538462 | 82 | 0.773913 | # SPDX-License-Identifier: MIT
"""The application's interfaces that are used to connect the different components.
Notes
-----
This package's code is not really specific to the Django framework. It is an
abstraction layer.
Primary focus is the provision of a plugin API, that allows the app to be
extendable with third... | 0 | 0 | 0 |
8b3f5bf2170e6f1f55a1f584308e631727c5174c | 1,387 | py | Python | Final Project/src/main.py | tig3r66/CMPUT275 | dd5b94dcf0436e281f4696959db07b56f5c0b9d8 | [
"MIT"
] | 1 | 2022-01-25T05:19:15.000Z | 2022-01-25T05:19:15.000Z | Final Project/src/main.py | tig3r66/CMPUT275 | dd5b94dcf0436e281f4696959db07b56f5c0b9d8 | [
"MIT"
] | null | null | null | Final Project/src/main.py | tig3r66/CMPUT275 | dd5b94dcf0436e281f4696959db07b56f5c0b9d8 | [
"MIT"
] | null | null | null | # ===================================
# Name: Edward (Eddie) Guo
# ID: 1576381
# Partner: Jason Kim
# CMPUT 275, Fall 2020
#
# Final Assignment: EEG Visualizer
# ===================================
"""
Contains the QApplication which holds the PlotWindow QMainWindow object. The
controller class is here for c... | 26.673077 | 79 | 0.651045 | # ===================================
# Name: Edward (Eddie) Guo
# ID: 1576381
# Partner: Jason Kim
# CMPUT 275, Fall 2020
#
# Final Assignment: EEG Visualizer
# ===================================
"""
Contains the QApplication which holds the PlotWindow QMainWindow object. The
controller class is here for c... | 0 | 0 | 0 |
9bc6d6d5809746ae0dfad11e6d7e815c885010be | 929 | py | Python | utilipy/data_utils/tests/test_init.py | nstarman/utilipy | 17984942145d31126724df23500bafba18fb7516 | [
"BSD-3-Clause"
] | 2 | 2020-11-15T01:48:45.000Z | 2020-12-02T20:44:20.000Z | utilipy/data_utils/tests/test_init.py | nstarman/astroPHD | 17984942145d31126724df23500bafba18fb7516 | [
"BSD-3-Clause"
] | 22 | 2020-09-13T17:58:24.000Z | 2022-02-04T19:05:23.000Z | utilipy/data_utils/tests/test_init.py | nstarman/utilipy | 17984942145d31126724df23500bafba18fb7516 | [
"BSD-3-Clause"
] | 1 | 2020-04-21T22:41:01.000Z | 2020-04-21T22:41:01.000Z | # -*- coding: utf-8 -*-
"""Test Code in __init__."""
__all__ = [
"test_get_path_to_file",
]
##############################################################################
# IMPORTS
# BUILT-IN
import os.path
# PROJECT-SPECIFIC
from utilipy.data_utils.utils import get_path_to_file
#############################... | 21.113636 | 78 | 0.339074 | # -*- coding: utf-8 -*-
"""Test Code in __init__."""
__all__ = [
"test_get_path_to_file",
]
##############################################################################
# IMPORTS
# BUILT-IN
import os.path
# PROJECT-SPECIFIC
from utilipy.data_utils.utils import get_path_to_file
#############################... | 187 | 0 | 23 |
22e65f52c1dd2e9a786884bce3811c3aa03273e2 | 2,579 | py | Python | eStore/migrations/0005_auto_20210420_2220.py | masrufjaman/gas-n-go | 435e574a1b1bbd875a8a7aeade4d4c2dc1636b07 | [
"MIT"
] | null | null | null | eStore/migrations/0005_auto_20210420_2220.py | masrufjaman/gas-n-go | 435e574a1b1bbd875a8a7aeade4d4c2dc1636b07 | [
"MIT"
] | 9 | 2021-03-22T18:36:25.000Z | 2021-04-20T17:39:47.000Z | eStore/migrations/0005_auto_20210420_2220.py | masrufjaman/gas-n-go | 435e574a1b1bbd875a8a7aeade4d4c2dc1636b07 | [
"MIT"
] | 2 | 2021-06-30T14:39:52.000Z | 2021-08-12T19:41:11.000Z | # Generated by Django 3.1.7 on 2021-04-20 16:20
from django.db import migrations, models
import django.db.models.deletion
| 40.936508 | 150 | 0.598682 | # Generated by Django 3.1.7 on 2021-04-20 16:20
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('accounts', '0006_auto_20210406_1400'),
('eStore', '0004_item_discount_price'),
]
operations = [
mig... | 0 | 2,432 | 23 |
72dfafe3d10bd2db54f014bbf5184b6be818ecf0 | 9,310 | py | Python | sdk/python/kfp/v2/dsl/experimental/for_loop.py | ryansteakley/pipelines | 98677b2190fb327be68e4bb0d00c520593707f21 | [
"Apache-2.0"
] | 1 | 2021-10-23T00:39:47.000Z | 2021-10-23T00:39:47.000Z | sdk/python/kfp/v2/dsl/experimental/for_loop.py | ryansteakley/pipelines | 98677b2190fb327be68e4bb0d00c520593707f21 | [
"Apache-2.0"
] | null | null | null | sdk/python/kfp/v2/dsl/experimental/for_loop.py | ryansteakley/pipelines | 98677b2190fb327be68e4bb0d00c520593707f21 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 34.868914 | 81 | 0.628249 | # Copyright 2021 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 368 | 0 | 27 |
e0cb3175c59da0065800bb2675b16b000572cbc4 | 9,948 | py | Python | .github/workflows/templates/generate.py | s0undt3ch/salt-bootstrap | 11e5a237a922425c0e11608eec37bb4fde8d4577 | [
"Apache-2.0"
] | null | null | null | .github/workflows/templates/generate.py | s0undt3ch/salt-bootstrap | 11e5a237a922425c0e11608eec37bb4fde8d4577 | [
"Apache-2.0"
] | null | null | null | .github/workflows/templates/generate.py | s0undt3ch/salt-bootstrap | 11e5a237a922425c0e11608eec37bb4fde8d4577 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import datetime
os.chdir(os.path.abspath(os.path.dirname(__file__)))
LINUX_DISTROS = [
"almalinux-8",
"amazon-2",
"arch",
"centos-7",
"centos-8",
"debian-10",
"debian-11",
"debian-9",
"fedora-33",
"fedora-34",
"fedora-... | 28.918605 | 157 | 0.441998 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import datetime
os.chdir(os.path.abspath(os.path.dirname(__file__)))
LINUX_DISTROS = [
"almalinux-8",
"amazon-2",
"arch",
"centos-7",
"centos-8",
"debian-10",
"debian-11",
"debian-9",
"fedora-33",
"fedora-34",
"fedora-... | 6,927 | 0 | 23 |
4c2b178af364b6b782db82646942cb0a6c95a702 | 17,831 | py | Python | qiskit/aqua/algorithms/single_sample/shor/shor.py | Nick-Singstock/qiskit-aqua | 8c2bc57b78dec447faec3adbc966471a3206c2ef | [
"Apache-2.0"
] | 1 | 2020-11-06T01:09:28.000Z | 2020-11-06T01:09:28.000Z | qiskit/aqua/algorithms/single_sample/shor/shor.py | Nick-Singstock/qiskit-aqua | 8c2bc57b78dec447faec3adbc966471a3206c2ef | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/algorithms/single_sample/shor/shor.py | Nick-Singstock/qiskit-aqua | 8c2bc57b78dec447faec3adbc966471a3206c2ef | [
"Apache-2.0"
] | 1 | 2020-11-06T01:09:43.000Z | 2020-11-06T01:09:43.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM Corp. 2017 and later.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.... | 36.464213 | 119 | 0.555213 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM Corp. 2017 and later.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.... | 2,572 | 0 | 58 |
14d1776a23dbeff91b7b113a7ec6193886a74ae5 | 3,802 | py | Python | src/game.py | Ale-XYX/Contrast | 6daf08e14826fbe382a6a8bbaa53f6c5a0494383 | [
"Apache-2.0"
] | null | null | null | src/game.py | Ale-XYX/Contrast | 6daf08e14826fbe382a6a8bbaa53f6c5a0494383 | [
"Apache-2.0"
] | null | null | null | src/game.py | Ale-XYX/Contrast | 6daf08e14826fbe382a6a8bbaa53f6c5a0494383 | [
"Apache-2.0"
] | 2 | 2020-02-03T14:04:11.000Z | 2020-05-15T16:44:33.000Z | import re
import bz2
import pygame
import public
import sprites
import functions
import dictionaries
import random
# :^)
| 25.689189 | 80 | 0.583377 | import re
import bz2
import pygame
import public
import sprites
import functions
import dictionaries
import random
def title(debug):
pygame.display.set_caption('Contrast')
pygame.display.set_icon(pygame.image.fromstring(bz2.decompress(
dictionaries.MEDIA['icon']), (32, 32), 'RGBA'))
info_text = p... | 3,608 | 0 | 69 |
2e0aa5f7b3230ca90001a4c7c190460a296a87de | 6,243 | py | Python | tabledataextractor/input/from_html.py | ELchem/tabledataextractor | 9eb38faf57611c26cdcaa8df13fd4e1cf36a4c21 | [
"MIT"
] | 4 | 2021-09-01T18:28:10.000Z | 2022-03-29T09:43:34.000Z | tabledataextractor/input/from_html.py | ELchem/tabledataextractor | 9eb38faf57611c26cdcaa8df13fd4e1cf36a4c21 | [
"MIT"
] | 3 | 2021-11-13T21:17:27.000Z | 2021-11-15T18:29:14.000Z | tabledataextractor/input/from_html.py | ELchem/tabledataextractor | 9eb38faf57611c26cdcaa8df13fd4e1cf36a4c21 | [
"MIT"
] | 2 | 2021-10-07T01:20:39.000Z | 2021-11-02T17:56:06.000Z | # -*- coding: utf-8 -*-
"""
Reads an `html` formatted table.
"""
import numpy as np
from bs4 import BeautifulSoup
import requests
from selenium import webdriver
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium... | 33.745946 | 223 | 0.606279 | # -*- coding: utf-8 -*-
"""
Reads an `html` formatted table.
"""
import numpy as np
from bs4 import BeautifulSoup
import requests
from selenium import webdriver
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium... | 0 | 0 | 0 |
8a2527c8ebf711cd89d50a2c1b007f80d07a457b | 924 | py | Python | 07/script.py | has-ctrl/advent-of-code-2021 | 09d309feb5082f108ab690f9e37abf6150b7283d | [
"MIT"
] | null | null | null | 07/script.py | has-ctrl/advent-of-code-2021 | 09d309feb5082f108ab690f9e37abf6150b7283d | [
"MIT"
] | null | null | null | 07/script.py | has-ctrl/advent-of-code-2021 | 09d309feb5082f108ab690f9e37abf6150b7283d | [
"MIT"
] | null | null | null | import numpy as np
test_data = np.array([16, 1, 2, 0, 4, 2, 7, 1, 2, 14])
np_data = np.loadtxt("data.txt", delimiter=",", dtype=int)
def one(data: np.ndarray) -> int:
"""
Determine the horizontal position that the crabs can align to using the least fuel possible. How much fuel must they
spend to align to... | 30.8 | 120 | 0.650433 | import numpy as np
test_data = np.array([16, 1, 2, 0, 4, 2, 7, 1, 2, 14])
np_data = np.loadtxt("data.txt", delimiter=",", dtype=int)
def one(data: np.ndarray) -> int:
"""
Determine the horizontal position that the crabs can align to using the least fuel possible. How much fuel must they
spend to align to... | 0 | 0 | 0 |
46445e6276cdd339ed1cb28a14605af7c00ee8a9 | 787 | py | Python | docs/src/callbackgen.py | aristanetworks/ctypegen | 379f8e5c712c8deb0ed27cbf005d7706fa11e6e8 | [
"Apache-2.0"
] | 17 | 2018-06-12T10:07:42.000Z | 2022-03-23T14:03:33.000Z | docs/src/callbackgen.py | aristanetworks/ctypegen | 379f8e5c712c8deb0ed27cbf005d7706fa11e6e8 | [
"Apache-2.0"
] | 4 | 2018-10-29T17:55:34.000Z | 2021-10-08T07:19:12.000Z | docs/src/callbackgen.py | aristanetworks/ctypegen | 379f8e5c712c8deb0ed27cbf005d7706fa11e6e8 | [
"Apache-2.0"
] | 7 | 2018-12-20T19:35:45.000Z | 2021-05-18T03:42:17.000Z | # Copyright (c) 2018 Arista Networks, Inc. All rights reserved.
# Arista Networks, Inc. Confidential and Proprietary.
#
# DON'T EDIT THIS FILE. It was generated by
# /usr/local/lib/python2.7/dist-packages/CTypeGen.py
# Please see AID/3558 for details on the contents of this file
#
from ctypes import * # pylint: disabl... | 21.861111 | 64 | 0.684879 | # Copyright (c) 2018 Arista Networks, Inc. All rights reserved.
# Arista Networks, Inc. Confidential and Proprietary.
#
# DON'T EDIT THIS FILE. It was generated by
# /usr/local/lib/python2.7/dist-packages/CTypeGen.py
# Please see AID/3558 for details on the contents of this file
#
from ctypes import * # pylint: disabl... | 108 | 0 | 23 |
f5ccf91f07f564599f0a2cf7b1cc3268aa005d97 | 1,296 | py | Python | generated-libraries/python/ports.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | 2 | 2017-03-28T15:31:26.000Z | 2018-08-16T22:15:18.000Z | generated-libraries/python/ports.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | generated-libraries/python/ports.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | from netapp.connection import NaErrorResponse, NaPagedResponse
from netapp.net import NetConnection
from netapp.net.net_port_info import NetPortInfo
conn = NetConnection("192.168.135.100", "admin", "mehmeh123")
print "LISTING ALL PORTS:"
print "-----------------------------------------------"
query = NetPortInfo(nod... | 35.027027 | 106 | 0.622685 | from netapp.connection import NaErrorResponse, NaPagedResponse
from netapp.net import NetConnection
from netapp.net.net_port_info import NetPortInfo
conn = NetConnection("192.168.135.100", "admin", "mehmeh123")
print "LISTING ALL PORTS:"
print "-----------------------------------------------"
query = NetPortInfo(nod... | 0 | 0 | 0 |
4041a20fc51def3b3801556656d9b21062ae0f2d | 185 | py | Python | torch/fx/experimental/unification/__init__.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 60,067 | 2017-01-18T17:21:31.000Z | 2022-03-31T21:37:45.000Z | torch/fx/experimental/unification/__init__.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 66,955 | 2017-01-18T17:21:38.000Z | 2022-03-31T23:56:11.000Z | torch/fx/experimental/unification/__init__.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 19,210 | 2017-01-18T17:45:04.000Z | 2022-03-31T23:51:56.000Z | # type: ignore[attr-defined]
from .core import unify, reify # noqa: F403
from .more import unifiable # noqa: F403
from .variable import var, isvar, vars, variables, Var # noqa: F403
| 37 | 68 | 0.724324 | # type: ignore[attr-defined]
from .core import unify, reify # noqa: F403
from .more import unifiable # noqa: F403
from .variable import var, isvar, vars, variables, Var # noqa: F403
| 0 | 0 | 0 |
3be09ddb058024d53f0d37a425c547e2ad46cc57 | 2,147 | py | Python | psinsights/rules.py | paulcronk/psinsights | cd465f20254fbdb30032ce40b6fe30d32de0d524 | [
"Apache-2.0"
] | null | null | null | psinsights/rules.py | paulcronk/psinsights | cd465f20254fbdb30032ce40b6fe30d32de0d524 | [
"Apache-2.0"
] | null | null | null | psinsights/rules.py | paulcronk/psinsights | cd465f20254fbdb30032ce40b6fe30d32de0d524 | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# Copyright 2012 FastSoft Inc.
# Copyright 2012 Devin Anderson <danderson (at) fastsoft (dot) com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You m... | 28.626667 | 79 | 0.583605 | ###############################################################################
# Copyright 2012 FastSoft Inc.
# Copyright 2012 Devin Anderson <danderson (at) fastsoft (dot) com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You m... | 926 | 348 | 23 |
662efd1261fb763f2ca5bdab861633e763419ddb | 552 | py | Python | exercicio-condicional/questao-1.py | maumneto/exercicio-python | bd57cd9f3b48c76ea3f8195544d347bc1b0c943e | [
"MIT"
] | null | null | null | exercicio-condicional/questao-1.py | maumneto/exercicio-python | bd57cd9f3b48c76ea3f8195544d347bc1b0c943e | [
"MIT"
] | null | null | null | exercicio-condicional/questao-1.py | maumneto/exercicio-python | bd57cd9f3b48c76ea3f8195544d347bc1b0c943e | [
"MIT"
] | 1 | 2020-04-27T15:01:10.000Z | 2020-04-27T15:01:10.000Z | '''
Faça um programa que leia o salário de um trabalhador e o valor
da prestação de um empréstimo. Se a prestação for maior que 20%
do salário imprima: “Empréstimo não concedido”; caso contrário imprima: “Empréstimo concedido”.
'''
# entrada de dados
salarao = float(input('Digite o valor do salario: '))
prestacao = fl... | 30.666667 | 95 | 0.733696 | '''
Faça um programa que leia o salário de um trabalhador e o valor
da prestação de um empréstimo. Se a prestação for maior que 20%
do salário imprima: “Empréstimo não concedido”; caso contrário imprima: “Empréstimo concedido”.
'''
# entrada de dados
salarao = float(input('Digite o valor do salario: '))
prestacao = fl... | 0 | 0 | 0 |
4b998a8b759bc5a4cf2d3b91ee6979cd04cfc889 | 12,997 | py | Python | Firefly/services/firefly_security_and_monitoring/firefly_monitoring.py | Firefly-Automation/Firefly | fccf40b8f6e015ef34c292264184090eb8d860b7 | [
"Apache-2.0"
] | 20 | 2017-03-24T08:25:50.000Z | 2020-07-07T16:09:34.000Z | Firefly/services/firefly_security_and_monitoring/firefly_monitoring.py | Firefly-Automation/Firefly | fccf40b8f6e015ef34c292264184090eb8d860b7 | [
"Apache-2.0"
] | 1 | 2017-11-02T17:46:48.000Z | 2017-11-02T17:46:48.000Z | Firefly/services/firefly_security_and_monitoring/firefly_monitoring.py | Firefly-Automation/Firefly | fccf40b8f6e015ef34c292264184090eb8d860b7 | [
"Apache-2.0"
] | 5 | 2017-04-11T02:27:38.000Z | 2020-12-11T07:44:00.000Z | """
Firefly Security and Monitoring
This is the core Firefly Security and Monitoring Service. There should be almost zero config to the user and firefly will monitor the entire house.
- Alarm System (Away)
- Alarm System (Night)
- Vacation Lighting
- Battery Monitor
- Smoke Alerts
- Flooding Alerts
"""
from Firefly im... | 38.11437 | 183 | 0.701239 | """
Firefly Security and Monitoring
This is the core Firefly Security and Monitoring Service. There should be almost zero config to the user and firefly will monitor the entire house.
- Alarm System (Away)
- Alarm System (Night)
- Vacation Lighting
- Battery Monitor
- Smoke Alerts
- Flooding Alerts
"""
from Firefly im... | 10,104 | 1,232 | 23 |
0c76885b70fe7b575d9278df97a40daf190c7e04 | 324 | py | Python | optirocket/library/constants.py | Keith-Maxwell/OptiRocket | d99ac8d2b868b60a2bbf32f5a8a31ecdcaeea5b0 | [
"MIT"
] | null | null | null | optirocket/library/constants.py | Keith-Maxwell/OptiRocket | d99ac8d2b868b60a2bbf32f5a8a31ecdcaeea5b0 | [
"MIT"
] | 3 | 2021-01-14T15:09:51.000Z | 2021-02-12T17:05:18.000Z | optirocket/library/constants.py | Keith-Maxwell/OptiRocket | d99ac8d2b868b60a2bbf32f5a8a31ecdcaeea5b0 | [
"MIT"
] | 1 | 2021-01-11T02:34:29.000Z | 2021-01-11T02:34:29.000Z | # standard gravitational parameter for Earth = G*M
EARTH_GRAV_CONST = 3.986005e5 # (km^3/s^2)
# Earth Radius
EARTH_RADIUS = 6378.137 # (km)
# Earth rotation speed (calculated from sideral period)
EARTH_ROT_RATE = 6.300387486749 / 86164 # (rad/s)
# Earth gravitation at sea leve
EARTH_GRAV_SEA_LVL = 9.80665 # (m^2... | 27 | 55 | 0.725309 | # standard gravitational parameter for Earth = G*M
EARTH_GRAV_CONST = 3.986005e5 # (km^3/s^2)
# Earth Radius
EARTH_RADIUS = 6378.137 # (km)
# Earth rotation speed (calculated from sideral period)
EARTH_ROT_RATE = 6.300387486749 / 86164 # (rad/s)
# Earth gravitation at sea leve
EARTH_GRAV_SEA_LVL = 9.80665 # (m^2... | 0 | 0 | 0 |
42488845e1b00797f2c42f02abc38006597e292a | 4,539 | py | Python | my_utils/misc.py | Jennifercheukyin/High-Speed-Pedestrian-Crossing-Prediction | 09cceb0efaf4d074ee16d11d8f91292ce9dec854 | [
"MIT"
] | 4 | 2021-10-22T01:33:16.000Z | 2022-03-09T06:39:54.000Z | my_utils/misc.py | Jennifercheukyin/High-Speed-Pedestrian-Crossing-Prediction | 09cceb0efaf4d074ee16d11d8f91292ce9dec854 | [
"MIT"
] | null | null | null | my_utils/misc.py | Jennifercheukyin/High-Speed-Pedestrian-Crossing-Prediction | 09cceb0efaf4d074ee16d11d8f91292ce9dec854 | [
"MIT"
] | null | null | null | '''Some helper functions for PyTorch, including:
- get_mean_and_std: calculate the mean and std value of dataset.
- msr_init: net parameter initialization.
- progress_bar: progress bar mimic xlua.progress.
'''
import errno
import os
import sys
import time
import math
import torch.nn as nn
import torch.nn.i... | 30.463087 | 118 | 0.592642 | '''Some helper functions for PyTorch, including:
- get_mean_and_std: calculate the mean and std value of dataset.
- msr_init: net parameter initialization.
- progress_bar: progress bar mimic xlua.progress.
'''
import errno
import os
import sys
import time
import math
import torch.nn as nn
import torch.nn.i... | 2,101 | 16 | 428 |
ca91f55ea74fe8da53eabdf2dc43a829dbcf7253 | 1,697 | py | Python | gradient_decent_simple_linear_regression.py | eshanmherath/linear-regression | 5b473586679a4b4594706faeb2bb7e4922c7ab38 | [
"MIT"
] | 1 | 2020-12-09T04:19:46.000Z | 2020-12-09T04:19:46.000Z | gradient_decent_simple_linear_regression.py | eshanmherath/linear-regression | 5b473586679a4b4594706faeb2bb7e4922c7ab38 | [
"MIT"
] | null | null | null | gradient_decent_simple_linear_regression.py | eshanmherath/linear-regression | 5b473586679a4b4594706faeb2bb7e4922c7ab38 | [
"MIT"
] | null | null | null | import numpy as np
np.random.seed(111)
'''
The data is generated adding noise to the values from y = 0.8x + 2 equation
Therefore the expectation of the auto encoder is to get the values w and b closer to 0.8 and 2 respectively
'''
'''generate random x values'''
X_train = np.random.random((1, 50))[0]
'''get the ref... | 28.762712 | 107 | 0.625221 | import numpy as np
np.random.seed(111)
'''
The data is generated adding noise to the values from y = 0.8x + 2 equation
Therefore the expectation of the auto encoder is to get the values w and b closer to 0.8 and 2 respectively
'''
'''generate random x values'''
X_train = np.random.random((1, 50))[0]
'''get the ref... | 788 | 0 | 23 |
b2107b59ecdecdb0d53f298a0ed4ee2762c4cc8c | 458 | py | Python | 1_mundo_exercicios/ex018.py | GuilhermeLima182/CursoDePython | 7e72b117142794c38cbb14284d0fa6e1dbee5bf6 | [
"MIT"
] | null | null | null | 1_mundo_exercicios/ex018.py | GuilhermeLima182/CursoDePython | 7e72b117142794c38cbb14284d0fa6e1dbee5bf6 | [
"MIT"
] | null | null | null | 1_mundo_exercicios/ex018.py | GuilhermeLima182/CursoDePython | 7e72b117142794c38cbb14284d0fa6e1dbee5bf6 | [
"MIT"
] | null | null | null | #Faça um programa que leia um ângulo qualquer e mostre na tela
#o valor do seno,cosseno e tangente desse ângulo.
from math import radians, sin, cos, tan
angulo = int(input('Digite um ângulo: '))
sen = sin(radians(angulo))
cos = cos(radians(angulo))
tan = tan(radians(angulo))
print('O seno do ângulo {} é {:.2f}'.format... | 38.166667 | 62 | 0.696507 | #Faça um programa que leia um ângulo qualquer e mostre na tela
#o valor do seno,cosseno e tangente desse ângulo.
from math import radians, sin, cos, tan
angulo = int(input('Digite um ângulo: '))
sen = sin(radians(angulo))
cos = cos(radians(angulo))
tan = tan(radians(angulo))
print('O seno do ângulo {} é {:.2f}'.format... | 0 | 0 | 0 |
624916c3d5ec04f32ee59e6547283d5f7ef4f28e | 1,313 | py | Python | source/_sample/sympy/stereograph.py | showa-yojyo/notebook | 82c15074c24d64a1dfcb70a526bc1deb2ecffe68 | [
"MIT"
] | 14 | 2016-04-13T08:10:02.000Z | 2021-04-19T09:42:51.000Z | source/_sample/sympy/stereograph.py | showa-yojyo/note | 5f262ecda3df132cb66206c465d16e174061d6b9 | [
"MIT"
] | 88 | 2017-09-27T15:07:05.000Z | 2019-10-02T04:05:03.000Z | source/_sample/sympy/stereograph.py | showa-yojyo/note | 5f262ecda3df132cb66206c465d16e174061d6b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""stereograph.py: Compute length of a geodesic in the unit sphere.
"""
from sympy import (symbols, Function, Matrix, factor, simplify, latex, sqrt)
from sympy.abc import (t, xi, eta)
from sympy.printing import print_latex
if __name__ == '__main__':
main()
| 32.825 | 76 | 0.581112 | #!/usr/bin/env python
"""stereograph.py: Compute length of a geodesic in the unit sphere.
"""
from sympy import (symbols, Function, Matrix, factor, simplify, latex, sqrt)
from sympy.abc import (t, xi, eta)
from sympy.printing import print_latex
def main():
u, v, R = symbols('u v R', real=True)
xi, eta = symbo... | 1,005 | 0 | 23 |
9ee6af17b80095ba1ce3ce97e7b719c8cc0ba35d | 357 | py | Python | visdialch/decoders/__init__.py | mohitsudhakar/visual-dialog-experiments | 77cc65938b0ce99fc52b839b7821f29c7a6b32a0 | [
"BSD-3-Clause"
] | 1 | 2020-11-15T07:40:18.000Z | 2020-11-15T07:40:18.000Z | visdialch/decoders/__init__.py | mohitsudhakar/visual-dialog-experiments | 77cc65938b0ce99fc52b839b7821f29c7a6b32a0 | [
"BSD-3-Clause"
] | 3 | 2020-11-13T19:53:06.000Z | 2020-11-16T01:23:10.000Z | visdialch/decoders/__init__.py | mohitsudhakar/visual-dialog-experiments | 77cc65938b0ce99fc52b839b7821f29c7a6b32a0 | [
"BSD-3-Clause"
] | null | null | null | # from visdialch.decoders.gen import GenerativeDecoder
#from visdialch.decoders.disc import DiscriminativeDecoder
from visdialch.decoders.decoder import DiscriminativeDecoder
| 44.625 | 76 | 0.812325 | # from visdialch.decoders.gen import GenerativeDecoder
#from visdialch.decoders.disc import DiscriminativeDecoder
from visdialch.decoders.decoder import DiscriminativeDecoder
def Decoder(model_config, *args):
name_dec_map = {"disc": DiscriminativeDecoder, "gen": GenerativeDecoder}
return name_dec_map[model_con... | 159 | 0 | 23 |
8389323ee21ddfba844127da575ffe9542fde2b5 | 1,761 | py | Python | test/unit/graph/test_node.py | uSpike/ansible-discover | 74ed24d01bf305f45d0bb3485846291d8b3ca473 | [
"MIT"
] | 4 | 2018-08-22T19:56:47.000Z | 2021-11-15T16:11:21.000Z | test/unit/graph/test_node.py | uSpike/ansible-discover | 74ed24d01bf305f45d0bb3485846291d8b3ca473 | [
"MIT"
] | 11 | 2018-03-09T08:35:47.000Z | 2018-08-17T20:05:58.000Z | test/unit/graph/test_node.py | uSpike/ansible-discover | 74ed24d01bf305f45d0bb3485846291d8b3ca473 | [
"MIT"
] | 3 | 2018-08-14T15:35:31.000Z | 2021-11-15T16:11:24.000Z | import pytest
from ansiblediscover.graph.node import Node
@pytest.mark.parametrize('this, other, equal', [
(('myname', 'mytype', 'mypath'), ('myname', 'mytype', 'mypath'), True),
(('myname', 'mytype', 'mypath'), ('othername', 'mytype', 'mypath'), False),
(('myname', 'mytype', 'mypath'), ('myname', '... | 27.092308 | 93 | 0.651902 | import pytest
from ansiblediscover.graph.node import Node
def test_build_identifier():
assert 'role:server_base' == Node.build_identifier('server_base', 'role')
def test_identifier():
node = Node('server_base', 'role', 'irrelevant')
assert 'role:server_base' == node.identifier()
def test_add_successo... | 1,070 | 0 | 159 |
92a5c4abb10045ba60521150fcb257f838c2d9c5 | 3,288 | py | Python | Core/Grader.py | brnomendes/grader-edx | d5a168bf82100f6b1196d927d1dff81ca9ad7070 | [
"MIT"
] | null | null | null | Core/Grader.py | brnomendes/grader-edx | d5a168bf82100f6b1196d927d1dff81ca9ad7070 | [
"MIT"
] | 1 | 2017-04-11T23:58:00.000Z | 2017-04-11T23:58:00.000Z | Core/Grader.py | brnomendes/grader-edx | d5a168bf82100f6b1196d927d1dff81ca9ad7070 | [
"MIT"
] | null | null | null | import datetime
from Models.Submission import Submission
from Core.Database import Database
from Core.Scorer import Scorer
from Core.Executer import Executer
from Core.Parser import Parser
| 43.263158 | 129 | 0.667579 | import datetime
from Models.Submission import Submission
from Core.Database import Database
from Core.Scorer import Scorer
from Core.Executer import Executer
from Core.Parser import Parser
class Grader():
def __init__(self):
self._session = Database.session()
def run(self, anonymous_student_id, stud... | 2,933 | 147 | 23 |
3687c80748ad58f744cedde41cab9e69281efc9e | 44,472 | py | Python | nitorch/io/volumes/mapping.py | balbasty/nitorch | d30c3125a8a66ea1434f2b39ed03338afd9724b4 | [
"MIT"
] | 46 | 2020-07-31T10:14:05.000Z | 2022-03-24T12:51:46.000Z | nitorch/io/volumes/mapping.py | balbasty/nitorch | d30c3125a8a66ea1434f2b39ed03338afd9724b4 | [
"MIT"
] | 36 | 2020-10-06T19:01:38.000Z | 2022-02-03T18:07:35.000Z | nitorch/io/volumes/mapping.py | balbasty/nitorch | d30c3125a8a66ea1434f2b39ed03338afd9724b4 | [
"MIT"
] | 6 | 2021-01-05T14:59:05.000Z | 2021-11-18T18:26:45.000Z | from copy import copy
import torch
from nitorch.core.py import make_list
from nitorch.core import dtypes
from nitorch.spatial import affine_sub, affine_permute, voxel_size as affvx
from nitorch.io.utils.indexing import (expand_index, guess_shape, compose_index, neg2pos,
is_dropped... | 37.277452 | 93 | 0.565727 | from copy import copy
import torch
from nitorch.core.py import make_list
from nitorch.core import dtypes
from nitorch.spatial import affine_sub, affine_permute, voxel_size as affvx
from nitorch.io.utils.indexing import (expand_index, guess_shape, compose_index, neg2pos,
is_dropped... | 9,800 | 0 | 378 |
1a2deaef0215145916e743664ab5b8b9ed9d9543 | 302 | py | Python | blit.py | rwberendsen/blit | f025a286b04774ec6dc6a47823254484d3942b78 | [
"MIT"
] | null | null | null | blit.py | rwberendsen/blit | f025a286b04774ec6dc6a47823254484d3942b78 | [
"MIT"
] | null | null | null | blit.py | rwberendsen/blit | f025a286b04774ec6dc6a47823254484d3942b78 | [
"MIT"
] | null | null | null | """
blit.py
Call if you want to run everything
"""
import json
import os
import sys
import integrate
if __name__ == '__main__':
sys.exit(main(sys.argv))
| 10.785714 | 39 | 0.63245 | """
blit.py
Call if you want to run everything
"""
import json
import os
import sys
import integrate
def main(argv):
with open('config.json', 'r') as f:
config = json.load(f)
integrate.integrate(**config)
return 0
if __name__ == '__main__':
sys.exit(main(sys.argv))
| 112 | 0 | 23 |
33a51d04c0e22dbd80245e03d033a309d7a8fdfd | 367 | py | Python | pacote dowlond/curso python/exercicio100.py | Kaue-Marin/Curso-Python | 45f7920e288a49724a4284f14c7212bb1662ab5b | [
"MIT"
] | null | null | null | pacote dowlond/curso python/exercicio100.py | Kaue-Marin/Curso-Python | 45f7920e288a49724a4284f14c7212bb1662ab5b | [
"MIT"
] | null | null | null | pacote dowlond/curso python/exercicio100.py | Kaue-Marin/Curso-Python | 45f7920e288a49724a4284f14c7212bb1662ab5b | [
"MIT"
] | null | null | null | from random import randint
numeros = []
# programa principal
sorteia()
somapar() | 22.9375 | 47 | 0.577657 | from random import randint
numeros = []
def sorteia():
for c in range(1, 5):
c = randint(1, 9)
numeros.append(c)
print(f'os valores da lista são {numeros}')
def somapar():
spar = 0
for c2 in numeros:
if c2 % 2 == 0:
spar += c2
print(f'a soma dos numeros pares é {s... | 245 | 0 | 44 |
7f79dcf3d85037aa0b27e51ab5ee77202b2f17ac | 3,802 | py | Python | ch03/pro1.py | Lucid-ak/deeplearnig_practice | e196d733ee9b910a9c7648e61e6934aea9d255b3 | [
"MIT"
] | null | null | null | ch03/pro1.py | Lucid-ak/deeplearnig_practice | e196d733ee9b910a9c7648e61e6934aea9d255b3 | [
"MIT"
] | null | null | null | ch03/pro1.py | Lucid-ak/deeplearnig_practice | e196d733ee9b910a9c7648e61e6934aea9d255b3 | [
"MIT"
] | null | null | null | import pickle
import numpy as np #비선형 퍼셉트론
import matplotlib.pylab as plt
import sys, os
sys.path.append(os.pardir)
from dataset.mnist import load_mnist
from PIL import Image
def step_function(x):
'''
y = x > 0
return y.astype(np.int) #np.int와 dtype=int의 역할은 같다.
'''
ret... | 22.104651 | 99 | 0.584955 | import pickle
import numpy as np #비선형 퍼셉트론
import matplotlib.pylab as plt
import sys, os
sys.path.append(os.pardir)
from dataset.mnist import load_mnist
from PIL import Image
def AND(x1, x2):
x=np.array([x1,x2])
w=np.array([0.5, 0.5])
b= -0.7
theta = 0
tmp = np.sum(w*x)+b
if tmp<=thet... | 2,368 | 0 | 319 |
206b2d2a2c251900c661943dfaa5e9366d3668b1 | 9,055 | py | Python | slideatlas/security/blueprint.py | SlideAtlas/SlideAtlas-Server | 3b9cbd56eaa29ae08ae521e75616ea230fe26397 | [
"Apache-2.0"
] | 3 | 2015-10-10T10:17:26.000Z | 2020-12-14T09:42:19.000Z | slideatlas/security/blueprint.py | SlideAtlas/SlideAtlas-Server | 3b9cbd56eaa29ae08ae521e75616ea230fe26397 | [
"Apache-2.0"
] | 41 | 2015-02-03T19:47:28.000Z | 2017-02-06T23:24:26.000Z | slideatlas/security/blueprint.py | SlideAtlas/SlideAtlas-Server | 3b9cbd56eaa29ae08ae521e75616ea230fe26397 | [
"Apache-2.0"
] | 2 | 2016-04-04T18:23:27.000Z | 2017-11-14T22:34:58.000Z | # coding=utf-8
import copy
from flask import Markup, url_for
from flask.ext.security import Security, MongoEngineUserDatastore, user_registered
from flask.ext.security.core import _SecurityState
from flask.ext.security.core import _context_processor as security_default_context_processor
from flask.ext.security.views ... | 45.049751 | 163 | 0.661182 | # coding=utf-8
import copy
from flask import Markup, url_for
from flask.ext.security import Security, MongoEngineUserDatastore, user_registered
from flask.ext.security.core import _SecurityState
from flask.ext.security.core import _context_processor as security_default_context_processor
from flask.ext.security.views ... | 3,373 | 262 | 88 |
6e1958f96728d11d2e7418e4925be857a7286b3c | 1,616 | py | Python | flight/views.py | NedyalkoKr/airline | d704e8cd98901dc4bb0bf672cc2363432ada3f84 | [
"MIT"
] | null | null | null | flight/views.py | NedyalkoKr/airline | d704e8cd98901dc4bb0bf672cc2363432ada3f84 | [
"MIT"
] | null | null | null | flight/views.py | NedyalkoKr/airline | d704e8cd98901dc4bb0bf672cc2363432ada3f84 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.urls import reverse
from django.http import Http404, HttpResponseRedirect
from flight.models import Flight, Passenger
def index(request):
''' display all flights '''
context = {
'main_header': 'Flights',
'title': 'Flights',
'flights': Flig... | 36.727273 | 99 | 0.678218 | from django.shortcuts import render
from django.urls import reverse
from django.http import Http404, HttpResponseRedirect
from flight.models import Flight, Passenger
def index(request):
''' display all flights '''
context = {
'main_header': 'Flights',
'title': 'Flights',
'flights': Flig... | 651 | 0 | 23 |
c2f3cfc4cf7bad08a1bd21dc39bb6765de3670b2 | 419 | py | Python | setup1.py | Alexander437/Learning_repo | 4e40ad419f8117d014f789119f4b3583067020bb | [
"CC0-1.0"
] | null | null | null | setup1.py | Alexander437/Learning_repo | 4e40ad419f8117d014f789119f4b3583067020bb | [
"CC0-1.0"
] | null | null | null | setup1.py | Alexander437/Learning_repo | 4e40ad419f8117d014f789119f4b3583067020bb | [
"CC0-1.0"
] | null | null | null | from setuptools import setup, find_packages, Extension
from torch.utils import cpp_extension
setup(
name='my_lib',
version='0.0',
description='Learning setup',
packages=find_packages(),
ext_package='trt_pose',
ext_modules=[cpp_extension.CppExtension('plugins', [
'Learn_cpp/learn.cpp',
... | 23.277778 | 57 | 0.687351 | from setuptools import setup, find_packages, Extension
from torch.utils import cpp_extension
setup(
name='my_lib',
version='0.0',
description='Learning setup',
packages=find_packages(),
ext_package='trt_pose',
ext_modules=[cpp_extension.CppExtension('plugins', [
'Learn_cpp/learn.cpp',
... | 0 | 0 | 0 |
8678ddca56a8e9b76f05e9a0a06fe329c6224b43 | 8,342 | py | Python | bookops_callno/normalizer.py | BookOps-CAT/bookops-callno | a8f1d2744b3b53844dc97a5400ae87a2db92cd4c | [
"MIT"
] | null | null | null | bookops_callno/normalizer.py | BookOps-CAT/bookops-callno | a8f1d2744b3b53844dc97a5400ae87a2db92cd4c | [
"MIT"
] | null | null | null | bookops_callno/normalizer.py | BookOps-CAT/bookops-callno | a8f1d2744b3b53844dc97a5400ae87a2db92cd4c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from typing import Optional
from pymarc import Field
from unidecode import unidecode, UnidecodeError
from bookops_callno.errors import CallNoConstructorError
def remove_trailing_punctuation(value: str) -> str:
"""
Removes any trailing periods, commas, etc.
Args:
value:... | 23.902579 | 82 | 0.593743 | # -*- coding: utf-8 -*-
from typing import Optional
from pymarc import Field
from unidecode import unidecode, UnidecodeError
from bookops_callno.errors import CallNoConstructorError
def remove_trailing_punctuation(value: str) -> str:
"""
Removes any trailing periods, commas, etc.
Args:
value:... | 0 | 0 | 0 |
b721c28c4d1d01229eaf38efadeba74addb10f97 | 1,310 | py | Python | ex31.py | Lorranysousc/ExerciciosDeRepeticao | 4b8ac1c4eb3ac5d2739456a4f967e094fad70256 | [
"MIT"
] | null | null | null | ex31.py | Lorranysousc/ExerciciosDeRepeticao | 4b8ac1c4eb3ac5d2739456a4f967e094fad70256 | [
"MIT"
] | null | null | null | ex31.py | Lorranysousc/ExerciciosDeRepeticao | 4b8ac1c4eb3ac5d2739456a4f967e094fad70256 | [
"MIT"
] | null | null | null | '''O Sr. Manoel Joaquim expandiu seus negócios para além dos negócios de 1,99 e agora possui uma loja de conveniências. Faça um programa que implemente uma caixa registradora rudimentar. O programa deverá receber um número desconhecido de valores referentes aos preços das mercadorias. Um valor zero deve ser informado p... | 65.5 | 660 | 0.703817 | '''O Sr. Manoel Joaquim expandiu seus negócios para além dos negócios de 1,99 e agora possui uma loja de conveniências. Faça um programa que implemente uma caixa registradora rudimentar. O programa deverá receber um número desconhecido de valores referentes aos preços das mercadorias. Um valor zero deve ser informado p... | 0 | 0 | 0 |
c9bdceebaee8f789e4c6a4a1d04b4ef5a1c5d7f9 | 399 | py | Python | tests/unit/dummy/__init__.py | fabiannagel/schnetkit | bf0b9055bdc393d01ac6c3d5f17bb9db13297e32 | [
"MIT"
] | 1 | 2021-11-03T15:13:48.000Z | 2021-11-03T15:13:48.000Z | tests/unit/dummy/__init__.py | fabiannagel/schnetkit | bf0b9055bdc393d01ac6c3d5f17bb9db13297e32 | [
"MIT"
] | null | null | null | tests/unit/dummy/__init__.py | fabiannagel/schnetkit | bf0b9055bdc393d01ac6c3d5f17bb9db13297e32 | [
"MIT"
] | 1 | 2022-02-02T17:34:05.000Z | 2022-02-02T17:34:05.000Z | from schnetkit.engine import Stateful
models = [Dummy]
| 15.96 | 37 | 0.573935 | from schnetkit.engine import Stateful
class Dummy(Stateful):
def __init__(self, a=2):
self.a = a
self.state = "great"
def get_dict(self):
return {"a": self.a}
def get_state(self):
return {"state": self.state}
def restore(self, payload):
self.state = payload... | 182 | 1 | 158 |
4324c7df6b13227127944ca0a19c1650df6f0e53 | 7,020 | py | Python | zigbear/custom_protocol/SecurityLayer.py | philippnormann/zigbear | 3cfdb4c9b13adf1e785f27109194b575edf241af | [
"BSD-3-Clause"
] | 14 | 2020-04-15T09:43:20.000Z | 2022-01-29T19:36:27.000Z | zigbear/custom_protocol/SecurityLayer.py | philippnormann1337/zigbear | 3cfdb4c9b13adf1e785f27109194b575edf241af | [
"BSD-3-Clause"
] | null | null | null | zigbear/custom_protocol/SecurityLayer.py | philippnormann1337/zigbear | 3cfdb4c9b13adf1e785f27109194b575edf241af | [
"BSD-3-Clause"
] | 1 | 2020-06-06T21:41:10.000Z | 2020-06-06T21:41:10.000Z | import secrets
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from cryptography.ha... | 43.602484 | 110 | 0.670228 | import secrets
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from cryptography.ha... | 5,922 | -1 | 670 |
9af2d928d6cc2a53fd788a67b6c0a78899bbda9e | 1,106 | py | Python | tracks/BamFeatures.py | goeckslab/jbrowse-archive-creator | 438557136c9dd4eb0db89835e5d253e44b50a7a3 | [
"AFL-3.0"
] | null | null | null | tracks/BamFeatures.py | goeckslab/jbrowse-archive-creator | 438557136c9dd4eb0db89835e5d253e44b50a7a3 | [
"AFL-3.0"
] | null | null | null | tracks/BamFeatures.py | goeckslab/jbrowse-archive-creator | 438557136c9dd4eb0db89835e5d253e44b50a7a3 | [
"AFL-3.0"
] | null | null | null | #!/usr/bin/env python2
import os
import json
import logging
from TrackDb import TrackDb
from util import subtools
from util import santitizer
| 38.137931 | 114 | 0.699819 | #!/usr/bin/env python2
import os
import json
import logging
from TrackDb import TrackDb
from util import subtools
from util import santitizer
class BamFeatures(TrackDb):
def __init__(self, trackName, trackLabel, trackDataURL, trackType, dataType, extraSettings=None):
super(BamFeatures, self).__init__(tra... | 874 | 6 | 77 |
defb13f18fc11dc096d17386bf5d7d31a9e0c762 | 5,573 | py | Python | coolamqp/uplink/handshake.py | smok-serwis/coolamqp | d57ada0d478bd1ca94743ae341f6819ba85ea253 | [
"MIT"
] | 4 | 2018-06-20T13:59:35.000Z | 2021-08-31T12:03:59.000Z | coolamqp/uplink/handshake.py | piotrmaslanka/coolamqp | d57ada0d478bd1ca94743ae341f6819ba85ea253 | [
"MIT"
] | 33 | 2016-06-03T11:41:09.000Z | 2020-07-09T17:48:28.000Z | coolamqp/uplink/handshake.py | smok-serwis/coolamqp | d57ada0d478bd1ca94743ae341f6819ba85ea253 | [
"MIT"
] | null | null | null | # coding=UTF-8
from __future__ import absolute_import, division, print_function
"""
Provides reactors that can authenticate an AQMP session
"""
import six
import typing as tp
import copy
import logging
from coolamqp.framing.definitions import ConnectionStart, ConnectionStartOk, \
ConnectionTune, ConnectionTuneOk, ... | 39.524823 | 104 | 0.624978 | # coding=UTF-8
from __future__ import absolute_import, division, print_function
"""
Provides reactors that can authenticate an AQMP session
"""
import six
import typing as tp
import copy
import logging
from coolamqp.framing.definitions import ConnectionStart, ConnectionStartOk, \
ConnectionTune, ConnectionTuneOk, ... | 2,447 | 0 | 81 |
08045555ebdef5af831c50bb02363844d684733e | 10,852 | py | Python | nodejs-mobile/test/testpy/__init__.py | xuelongqy/cnode | ac256264d329e68b6c5ae3281b0e7bb5a95ae164 | [
"MIT"
] | null | null | null | nodejs-mobile/test/testpy/__init__.py | xuelongqy/cnode | ac256264d329e68b6c5ae3281b0e7bb5a95ae164 | [
"MIT"
] | 4 | 2020-03-13T14:45:49.000Z | 2020-03-15T16:31:22.000Z | nodejs-mobile/test/testpy/__init__.py | xuelongqy/cnode | ac256264d329e68b6c5ae3281b0e7bb5a95ae164 | [
"MIT"
] | 1 | 2020-03-15T16:02:18.000Z | 2020-03-15T16:02:18.000Z | # Copyright 2008 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | 39.176895 | 89 | 0.646056 | # Copyright 2008 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | 7,907 | 455 | 657 |
3e13d9f04c5b9e380942a3048140fa5f7f9bee3d | 919 | py | Python | patterns/creational/factory_method.py | zhaijingrong/patterns_in_python | 8cb53a58cbb78dc7ed578887a8e7c481cfa72c80 | [
"MIT"
] | null | null | null | patterns/creational/factory_method.py | zhaijingrong/patterns_in_python | 8cb53a58cbb78dc7ed578887a8e7c481cfa72c80 | [
"MIT"
] | null | null | null | patterns/creational/factory_method.py | zhaijingrong/patterns_in_python | 8cb53a58cbb78dc7ed578887a8e7c481cfa72c80 | [
"MIT"
] | null | null | null | """
抽象工厂方法--对象创建型模式
1. 目标
定义一个用于创建对象的接口, 让子类决定实例化哪一个类, 使一个类的实例化延迟到子类。
"""
if __name__ == '__main__':
cream_cake_factory = CreamCakeFactory()
cream_cake = cream_cake_factory.make_cake()
print(cream_cake)
fruit_cake_factory = FruitCakeFactory()
fruit_cake = fruit_cake_factory.make_cake()
... | 19.145833 | 47 | 0.671382 | """
抽象工厂方法--对象创建型模式
1. 目标
定义一个用于创建对象的接口, 让子类决定实例化哪一个类, 使一个类的实例化延迟到子类。
"""
class CakeFactory(object):
def make_cake(self):
print('make a cake')
class CreamCakeFactory(CakeFactory):
def make_cake(self):
print('make a cream cake')
return CreamCake()
class FruitCakeFactory(CakeFactory... | 252 | 35 | 294 |
8a8e864f9097a33ac84f3576473fa8671c78d0e2 | 1,583 | py | Python | website/account/models.py | divmoe/DASHBOARD | 42927dfca3797e0bde3e59288a156e33aec6790d | [
"MIT"
] | null | null | null | website/account/models.py | divmoe/DASHBOARD | 42927dfca3797e0bde3e59288a156e33aec6790d | [
"MIT"
] | null | null | null | website/account/models.py | divmoe/DASHBOARD | 42927dfca3797e0bde3e59288a156e33aec6790d | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
| 34.413043 | 77 | 0.722678 | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Customer (models.Model):
user=models.OneToOneField(User,null=True,on_delete=models.CASCADE)
name = models.CharField(max_length=100,null=True)
email= models.CharField(max_length=100,null=True)
phone=... | 102 | 1,290 | 90 |
0ce133badac8ace62355d38651dd265c044af4eb | 1,169 | py | Python | chromeos/tools/concat_dbus_conf_files.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | chromeos/tools/concat_dbus_conf_files.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 86 | 2015-10-21T13:02:42.000Z | 2022-03-14T07:50:50.000Z | chromeos/tools/concat_dbus_conf_files.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | #!/usr/bin/env python
# Copyright 2019 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.
"""Concatenates D-Bus busconfig files."""
import sys
import xml.etree.ElementTree
_BUSCONFIG_FILE_HEADER = b"""<!DOCTYPE busconfig
... | 26.568182 | 72 | 0.6929 | #!/usr/bin/env python
# Copyright 2019 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.
"""Concatenates D-Bus busconfig files."""
import sys
import xml.etree.ElementTree
_BUSCONFIG_FILE_HEADER = b"""<!DOCTYPE busconfig
... | 657 | 0 | 23 |
02525ed7d476b11f1d77ac07f48e44ec57a3ff58 | 282 | py | Python | rand.py | sriharikapu/RandomSequenceGenerator | 7491e43b117be3e24eb5b7d66762699ef4d7593a | [
"CC0-1.0"
] | 1 | 2022-02-08T01:47:03.000Z | 2022-02-08T01:47:03.000Z | rand.py | sriharikapu/RandomSequenceGenerator | 7491e43b117be3e24eb5b7d66762699ef4d7593a | [
"CC0-1.0"
] | null | null | null | rand.py | sriharikapu/RandomSequenceGenerator | 7491e43b117be3e24eb5b7d66762699ef4d7593a | [
"CC0-1.0"
] | null | null | null | import sys;
import numpy as np;
import pandas as pd;
np.set_printoptions(threshold=sys.maxsize)
# replace the range, sample size with your custom numbers
arr = np.array(np.random.choice(range(10000), 10000, replace=False))
print(arr)
DF = pd.DataFrame(arr)
DF.to_csv("temp.csv")
| 25.636364 | 69 | 0.755319 | import sys;
import numpy as np;
import pandas as pd;
np.set_printoptions(threshold=sys.maxsize)
# replace the range, sample size with your custom numbers
arr = np.array(np.random.choice(range(10000), 10000, replace=False))
print(arr)
DF = pd.DataFrame(arr)
DF.to_csv("temp.csv")
| 0 | 0 | 0 |
f78a75c01086c2ca55a46920abf7034c2037b15f | 2,062 | py | Python | src/dataset.py | kantharajucn/job_seniority_prediction | cad9147ffddab1c5ead878c2f9d9e48199dc0da9 | [
"Unlicense"
] | null | null | null | src/dataset.py | kantharajucn/job_seniority_prediction | cad9147ffddab1c5ead878c2f9d9e48199dc0da9 | [
"Unlicense"
] | null | null | null | src/dataset.py | kantharajucn/job_seniority_prediction | cad9147ffddab1c5ead878c2f9d9e48199dc0da9 | [
"Unlicense"
] | null | null | null | import torch
from sklearn.preprocessing import LabelEncoder
from torch.utils.data import Dataset, DataLoader
| 33.258065 | 97 | 0.612027 | import torch
from sklearn.preprocessing import LabelEncoder
from torch.utils.data import Dataset, DataLoader
class JobsDataset(Dataset):
def __init__(self, X, y, tokenizer, max_len=512):
self.len = len(X)
self.data = X
self.y = y
self.tokenizer = tokenizer
self.max_len = ma... | 1,792 | 6 | 153 |