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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e6dd24213e8849445302890e3ae44f05104e1ef6 | 5,090 | py | Python | spoken_time/__init__.py | dnknth/spoken_time | 03ce7cf2ca5849bd4a8f834f8c8020834581e0ad | [
"MIT"
] | null | null | null | spoken_time/__init__.py | dnknth/spoken_time | 03ce7cf2ca5849bd4a8f834f8c8020834581e0ad | [
"MIT"
] | null | null | null | spoken_time/__init__.py | dnknth/spoken_time | 03ce7cf2ca5849bd4a8f834f8c8020834581e0ad | [
"MIT"
] | null | null | null | from datetime import datetime
from num2words import num2words
import gettext as gettext_module, locale, os
__all__ = ('spoken_time', 'absolute_spoken_date', 'relative_spoken_date')
# Reset locale for day & month names
locale.setlocale( locale.LC_ALL, '')
# Load translations for current locale
_language, _encoding ... | 35.347222 | 91 | 0.612574 | from datetime import datetime
from num2words import num2words
import gettext as gettext_module, locale, os
__all__ = ('spoken_time', 'absolute_spoken_date', 'relative_spoken_date')
# Reset locale for day & month names
locale.setlocale( locale.LC_ALL, '')
# Load translations for current locale
_language, _encoding ... | 87 | 0 | 23 |
c6c256c7d2e38f76b9bc5b0a1a1243958da84af3 | 1,950 | py | Python | designing-restful-apis/Lesson_4/13_BargainMart/Starter Code/views.py | robinl3680/udacity-course | 308daf62479f9bf6f4256eb19313631f1bb4c5da | [
"MIT"
] | 68 | 2016-07-28T07:24:57.000Z | 2021-10-09T19:28:48.000Z | designing-restful-apis/Lesson_4/13_BargainMart/Starter Code/views.py | robinl3680/udacity-course | 308daf62479f9bf6f4256eb19313631f1bb4c5da | [
"MIT"
] | 1 | 2022-03-12T01:01:42.000Z | 2022-03-12T01:01:42.000Z | designing-restful-apis/Lesson_4/13_BargainMart/Starter Code/views.py | robinl3680/udacity-course | 308daf62479f9bf6f4256eb19313631f1bb4c5da | [
"MIT"
] | 105 | 2016-10-19T03:56:33.000Z | 2022-03-15T02:12:08.000Z | from redis import Redis
import time
from functools import update_wrapper
from flask import request, g
from flask import Flask, jsonify
from models import Base, Item
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, sessionmaker
from sqlalchemy import create_engine
impo... | 34.210526 | 192 | 0.695385 | from redis import Redis
import time
from functools import update_wrapper
from flask import request, g
from flask import Flask, jsonify
from models import Base, Item
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, sessionmaker
from sqlalchemy import create_engine
impo... | 1,212 | 0 | 22 |
a3e3cf24cc7ef4954279e2183651357b813e7d64 | 6,824 | py | Python | app/dao/provider_details_dao.py | uk-gov-mirror/alphagov.notifications-api | 38af26cc784e63e6830b45c1bdfe9e8b72722e19 | [
"MIT"
] | 51 | 2016-04-03T23:36:17.000Z | 2022-03-21T20:04:52.000Z | app/dao/provider_details_dao.py | uk-gov-mirror/alphagov.notifications-api | 38af26cc784e63e6830b45c1bdfe9e8b72722e19 | [
"MIT"
] | 1,335 | 2015-12-15T14:28:50.000Z | 2022-03-30T16:24:27.000Z | app/dao/provider_details_dao.py | uk-gov-mirror/alphagov.notifications-api | 38af26cc784e63e6830b45c1bdfe9e8b72722e19 | [
"MIT"
] | 30 | 2016-01-08T19:05:32.000Z | 2021-12-20T16:37:23.000Z | from datetime import datetime, timedelta
from flask import current_app
from notifications_utils.timezones import convert_utc_to_bst
from sqlalchemy import asc, desc, func
from app import db
from app.dao.dao_utils import autocommit
from app.models import (
SMS_TYPE,
FactBilling,
ProviderDetails,
Provid... | 35.727749 | 119 | 0.748388 | from datetime import datetime, timedelta
from flask import current_app
from notifications_utils.timezones import convert_utc_to_bst
from sqlalchemy import asc, desc, func
from app import db
from app.dao.dao_utils import autocommit
from app.models import (
SMS_TYPE,
FactBilling,
ProviderDetails,
Provid... | 2,895 | 0 | 183 |
b11a302f53a38192c5dd68e4767ae96d3e146ef3 | 301 | py | Python | run.py | Prakash2403/ultron | 7d1067eb98ef52f6a88299534ea204e7ae45d7a7 | [
"MIT"
] | 13 | 2017-08-15T15:50:13.000Z | 2019-06-03T10:24:50.000Z | run.py | Prakash2403/ultron | 7d1067eb98ef52f6a88299534ea204e7ae45d7a7 | [
"MIT"
] | 3 | 2017-08-29T16:35:04.000Z | 2021-06-01T23:49:16.000Z | run.py | Prakash2403/ultron | 7d1067eb98ef52f6a88299534ea204e7ae45d7a7 | [
"MIT"
] | 4 | 2017-08-16T09:33:59.000Z | 2019-06-05T07:25:30.000Z | #! /usr/bin/python3
from default_settings import default_settings
from ultron_cli import UltronCLI
if __name__ == '__main__':
default_settings()
try:
UltronCLI().cmdloop()
except KeyboardInterrupt:
print("\nInterrupted by user.")
print("Goodbye")
exit(0)
| 23.153846 | 45 | 0.664452 | #! /usr/bin/python3
from default_settings import default_settings
from ultron_cli import UltronCLI
if __name__ == '__main__':
default_settings()
try:
UltronCLI().cmdloop()
except KeyboardInterrupt:
print("\nInterrupted by user.")
print("Goodbye")
exit(0)
| 0 | 0 | 0 |
b12a773973f8ed6172d8032f3bb0c450c07d8167 | 3,823 | py | Python | schavott/Assembler.py | emilhaegglund/staellning | 18034a07965705b121926cc685f69da46c36e54a | [
"MIT"
] | null | null | null | schavott/Assembler.py | emilhaegglund/staellning | 18034a07965705b121926cc685f69da46c36e54a | [
"MIT"
] | null | null | null | schavott/Assembler.py | emilhaegglund/staellning | 18034a07965705b121926cc685f69da46c36e54a | [
"MIT"
] | null | null | null | import subprocess
import schavott.gfatofasta
import os
import pyfasta
| 33.831858 | 87 | 0.586974 | import subprocess
import schavott.gfatofasta
import os
import pyfasta
class Assembly():
def __init__(self, output, path_to_np_reads):
self.nrReads = 0
self.assemblyCounter = 1
self.nrContigs = 0
self.N50 = 0
self.contig_size_dict = {}
self.output = output
sel... | 641 | 3,089 | 23 |
9aac18070a143c14d8d492fb678d936551f53c22 | 3,071 | py | Python | python/alien_python.py | AwIDoK/icfp2020-contest | 428bde70ea5ba66d03a9e3bf1bdbb532c6720137 | [
"MIT"
] | null | null | null | python/alien_python.py | AwIDoK/icfp2020-contest | 428bde70ea5ba66d03a9e3bf1bdbb532c6720137 | [
"MIT"
] | null | null | null | python/alien_python.py | AwIDoK/icfp2020-contest | 428bde70ea5ba66d03a9e3bf1bdbb532c6720137 | [
"MIT"
] | null | null | null | from alien_functions import *
| 29.815534 | 106 | 0.541517 | from alien_functions import *
def decode_alien(encoded):
prefix = encoded[0:2]
remainder = encoded[2:]
if prefix == "11":
# list
a, cont = decode_alien(remainder)
b, cont2 = decode_alien(cont)
return cons(a)(b), cont2
elif prefix == "01":
# positive
pos ... | 2,922 | 0 | 115 |
f1c684baf0130db947aa5d2c1d7a841cabb9d48f | 2,590 | py | Python | push_tester/__init__.py | DBeath/push-tester | 1851e28f5bdadc4d0f94ab2f88b0d39660196e02 | [
"MIT"
] | null | null | null | push_tester/__init__.py | DBeath/push-tester | 1851e28f5bdadc4d0f94ab2f88b0d39660196e02 | [
"MIT"
] | null | null | null | push_tester/__init__.py | DBeath/push-tester | 1851e28f5bdadc4d0f94ab2f88b0d39660196e02 | [
"MIT"
] | null | null | null | from flask import Flask
from flask.ext.login import current_user
from flask.ext.security import Security, SQLAlchemyUserDatastore
from flask_mail import Mail
from flask_debugtoolbar import DebugToolbarExtension
from werkzeug.contrib.fixers import ProxyFix
from flask.ext.admin import Admin, AdminIndexView
from flask.ext... | 28.152174 | 78 | 0.748649 | from flask import Flask
from flask.ext.login import current_user
from flask.ext.security import Security, SQLAlchemyUserDatastore
from flask_mail import Mail
from flask_debugtoolbar import DebugToolbarExtension
from werkzeug.contrib.fixers import ProxyFix
from flask.ext.admin import Admin, AdminIndexView
from flask.ext... | 1,728 | 36 | 145 |
9c44599437d73357f859a35a9a90690186183b72 | 277 | py | Python | 3.7.2/solution.py | luxnlex/stepic-python | 92a4b25391f76935c3c2a70fb8552e7f93928d9b | [
"MIT"
] | 1 | 2021-05-07T18:20:51.000Z | 2021-05-07T18:20:51.000Z | 3.7.2/solution.py | luxnlex/stepic-python | 92a4b25391f76935c3c2a70fb8552e7f93928d9b | [
"MIT"
] | null | null | null | 3.7.2/solution.py | luxnlex/stepic-python | 92a4b25391f76935c3c2a70fb8552e7f93928d9b | [
"MIT"
] | 2 | 2017-12-27T07:51:57.000Z | 2020-08-03T22:10:55.000Z | known = set()
unknown = set()
for _ in range(int(input())):
known.add(input().strip().lower())
for _ in range(int(input())):
for word in input().strip().lower().split():
if word not in known:
unknown.add(word)
for word in unknown:
print(word) | 21.307692 | 48 | 0.588448 | known = set()
unknown = set()
for _ in range(int(input())):
known.add(input().strip().lower())
for _ in range(int(input())):
for word in input().strip().lower().split():
if word not in known:
unknown.add(word)
for word in unknown:
print(word) | 0 | 0 | 0 |
747d3f750d3822cb89b4ca14242df24daedde520 | 1,368 | py | Python | filter_plugins/fcoe_boot_args.py | ArdanaCLM/osconfig-ansible | 5934cf8716aa5dc9cce05398a0cde31b4ef335d2 | [
"Apache-2.0"
] | null | null | null | filter_plugins/fcoe_boot_args.py | ArdanaCLM/osconfig-ansible | 5934cf8716aa5dc9cce05398a0cde31b4ef335d2 | [
"Apache-2.0"
] | 1 | 2018-06-05T12:48:20.000Z | 2018-06-05T13:19:58.000Z | filter_plugins/fcoe_boot_args.py | cmurphy/osconfig-ansible | a6c308317c090de4aa2539f6f89e4b5c1fb26a48 | [
"Apache-2.0"
] | 4 | 2018-03-14T13:10:51.000Z | 2019-09-30T19:05:50.000Z | #
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | 31.090909 | 75 | 0.698099 | #
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | 546 | 6 | 73 |
492c2da1fef28c7ca6a402cce56a9d3c5d313a2f | 3,100 | py | Python | data_visualization.py | GouldGroup/SAXSpy | 329ffcf567a77ec2e889b0e62bd4a20077149d81 | [
"MIT"
] | 1 | 2021-09-22T14:26:39.000Z | 2021-09-22T14:26:39.000Z | data_visualization.py | GouldGroup/SAXSpy | 329ffcf567a77ec2e889b0e62bd4a20077149d81 | [
"MIT"
] | null | null | null | data_visualization.py | GouldGroup/SAXSpy | 329ffcf567a77ec2e889b0e62bd4a20077149d81 | [
"MIT"
] | 1 | 2021-09-23T12:19:39.000Z | 2021-09-23T12:19:39.000Z | from cProfile import label
import matplotlib.pyplot as plt
import numpy as np
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
import pickle
import random
from saxspy import debyeWaller as dwf
from scipy.interpolate import CubicSpline
from tqdm import tqdm
import saxspy
import umap
if __name__ ... | 32.978723 | 113 | 0.67871 | from cProfile import label
import matplotlib.pyplot as plt
import numpy as np
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
import pickle
import random
from saxspy import debyeWaller as dwf
from scipy.interpolate import CubicSpline
from tqdm import tqdm
import saxspy
import umap
def load_dat... | 2,388 | 0 | 138 |
36b3ed2d7bdc7403e669f04fd7a1dddad4c3779c | 2,014 | py | Python | code/python/FactSetOwnership/v1/setup.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/FactSetOwnership/v1/setup.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/FactSetOwnership/v1/setup.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
FactSet Ownership API
FactSet’s Fund Ownership API gives access to both **Holdings** and **Holders** data.<p> Factset's Holdings endpoints gives access to all the underlying securities and their position detils held within a given fund. Fund Types supported include Open-End Mutual Funds, Closed-end Mutual ... | 41.958333 | 860 | 0.741807 | """
FactSet Ownership API
FactSet’s Fund Ownership API gives access to both **Holdings** and **Holders** data.<p> Factset's Holdings endpoints gives access to all the underlying securities and their position detils held within a given fund. Fund Types supported include Open-End Mutual Funds, Closed-end Mutual ... | 70 | 0 | 23 |
f0295029d79a670f5e9ff14c46c6c1e6e194ec1e | 9,447 | py | Python | third_party/chromite/cros_bisect/common_unittest.py | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | third_party/chromite/cros_bisect/common_unittest.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | third_party/chromite/cros_bisect/common_unittest.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test common module."""
from __future__ import print_function
from chromite.cros_bisect import common
from chromite.lib import... | 35.118959 | 79 | 0.68625 | # -*- coding: utf-8 -*-
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test common module."""
from __future__ import print_function
from chromite.cros_bisect import common
from chromite.lib import... | 126 | 0 | 48 |
6785120a01bb41650e4dcae2b05ae284de16d7d5 | 1,210 | py | Python | src/lod_api/tools/config_parser.py | efre-lod/efre-lod-api | 07b1f7755df4785868d08b1a11921de410f3b25c | [
"Apache-2.0"
] | 4 | 2019-11-27T15:59:17.000Z | 2021-06-16T11:18:19.000Z | src/lod_api/tools/config_parser.py | efre-lod/efre-lod-api | 07b1f7755df4785868d08b1a11921de410f3b25c | [
"Apache-2.0"
] | 3 | 2020-01-13T13:05:50.000Z | 2020-06-25T14:46:24.000Z | src/lod_api/tools/config_parser.py | efre-lod/efre-lod-api | 07b1f7755df4785868d08b1a11921de410f3b25c | [
"Apache-2.0"
] | 1 | 2019-10-07T14:07:46.000Z | 2019-10-07T14:07:46.000Z | import yaml
| 28.809524 | 79 | 0.547934 | import yaml
class ConfigParser:
def __init__(self, conf_fname):
with open(conf_fname) as stream:
self.conf = yaml.safe_load(stream)
self.conf["indices_list"] = self._get_indices()
self.conf["authorities_list"] = self._get_list_by_string("authorities")
self.conf["source... | 1,069 | -2 | 130 |
5445aa435a4f2fcce9b19c00eadb53dfb2a63ad7 | 46 | py | Python | taugeometric/tortuosity/__init__.py | eljosephavila123/taugeomectic | 64b66bc13844ad8a78a307802674a693e21a12d7 | [
"MIT"
] | 2 | 2021-02-27T20:58:00.000Z | 2021-07-09T03:50:31.000Z | taugeometric/tortuosity/__init__.py | eljosephavila123/taugeomectic | 64b66bc13844ad8a78a307802674a693e21a12d7 | [
"MIT"
] | 1 | 2021-01-11T07:32:33.000Z | 2021-01-11T07:32:33.000Z | taugeometric/tortuosity/__init__.py | eljosephavila123/taugeomectic | 64b66bc13844ad8a78a307802674a693e21a12d7 | [
"MIT"
] | 1 | 2021-01-11T05:18:03.000Z | 2021-01-11T05:18:03.000Z | from .__funcs__ import tortuosity_geometric_2d | 46 | 46 | 0.913043 | from .__funcs__ import tortuosity_geometric_2d | 0 | 0 | 0 |
ce59926c41052f8a17f03257e8eea30ebc63734f | 2,277 | py | Python | tests/fixtures/simple/unmarshalled.py | georgettica/jsonmarshal | 70593aca1018f4b506544c1dfd3f9e0b146962ec | [
"MIT"
] | 1 | 2020-07-16T14:42:27.000Z | 2020-07-16T14:42:27.000Z | tests/fixtures/simple/unmarshalled.py | georgettica/jsonmarshal | 70593aca1018f4b506544c1dfd3f9e0b146962ec | [
"MIT"
] | 2 | 2020-11-21T13:40:45.000Z | 2021-11-25T15:17:00.000Z | tests/fixtures/simple/unmarshalled.py | georgettica/jsonmarshal | 70593aca1018f4b506544c1dfd3f9e0b146962ec | [
"MIT"
] | 1 | 2020-11-21T13:38:57.000Z | 2020-11-21T13:38:57.000Z | from datetime import date, datetime
import pytz
from tests.fixtures.simple import Schema
from tests.fixtures.simple.schema import Item, Size
| 36.725806 | 86 | 0.636803 | from datetime import date, datetime
import pytz
from tests.fixtures.simple import Schema
from tests.fixtures.simple.schema import Item, Size
def get_unmarshalled() -> Schema:
item = Item(
int_key=100,
float_key=100.99,
str_key="string-key-value",
datetime_key=datetime(2020, 6, 22... | 2,110 | 0 | 23 |
0ce24b379702377db9666f3aea9f64e2c3ac3318 | 2,180 | py | Python | pytheus/collector.py | grilo/pytheus | a825bdfece22962ee8e91613c2fd38f00b2dfa40 | [
"MIT"
] | null | null | null | pytheus/collector.py | grilo/pytheus | a825bdfece22962ee8e91613c2fd38f00b2dfa40 | [
"MIT"
] | null | null | null | pytheus/collector.py | grilo/pytheus | a825bdfece22962ee8e91613c2fd38f00b2dfa40 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import logging
import collections
import traceback
import Queue
import threading
# Inspired by: https://stackoverflow.com/questions/2829329
| 33.030303 | 88 | 0.558257 | #!/usr/bin/env python
import logging
import collections
import traceback
import Queue
import threading
# Inspired by: https://stackoverflow.com/questions/2829329
class ExceptionThread(threading.Thread):
def __init__(self, *args, **kwargs):
threading.Thread.__init__(self, *args, **kwargs)
def run(sel... | 1,783 | 133 | 98 |
91255470a07fe2dc93a0df608ba2c50701fb0485 | 6,494 | py | Python | mando/tests/test_core.py | mollypi/mando | 8e28ada5654693cf51f05ccd74fd3bfce2984e02 | [
"MIT"
] | 46 | 2015-01-03T16:06:17.000Z | 2022-03-31T12:50:34.000Z | mando/tests/test_core.py | mollypi/mando | 8e28ada5654693cf51f05ccd74fd3bfce2984e02 | [
"MIT"
] | 40 | 2015-01-03T16:32:22.000Z | 2022-03-05T19:51:09.000Z | mando/tests/test_core.py | mollypi/mando | 8e28ada5654693cf51f05ccd74fd3bfce2984e02 | [
"MIT"
] | 15 | 2015-01-20T03:08:21.000Z | 2021-12-15T07:43:34.000Z | from contextlib import contextmanager
import pytest
from mando import Program
program = Program('example.py', '1.0.10')
program.option(
"-f", "--foo", dest='foo', default='bar', completer=NoopCompleter,
help="Real programmers don't comment their code. \
If it was hard to write, it should be hard ... | 25.367188 | 79 | 0.573452 | from contextlib import contextmanager
import pytest
from mando import Program
program = Program('example.py', '1.0.10')
def NoopCompleter(prefix, **kwd):
return []
program.option(
"-f", "--foo", dest='foo', default='bar', completer=NoopCompleter,
help="Real programmers don't comment their code. \
... | 873 | 0 | 243 |
7929d0db32c2f359c9b7f7ed2358c2b46a20ff37 | 342 | py | Python | python/binary_tree/965.univaluedbinaryTree.py | Nobodylesszb/LeetCode | 0e902f6bff4834a93ce64cf9c57fd64297e63523 | [
"MIT"
] | null | null | null | python/binary_tree/965.univaluedbinaryTree.py | Nobodylesszb/LeetCode | 0e902f6bff4834a93ce64cf9c57fd64297e63523 | [
"MIT"
] | null | null | null | python/binary_tree/965.univaluedbinaryTree.py | Nobodylesszb/LeetCode | 0e902f6bff4834a93ce64cf9c57fd64297e63523 | [
"MIT"
] | null | null | null | import collections
# using the queue | 28.5 | 64 | 0.54386 | import collections
class Solution(object):
# using the queue
def isUnivalTree(self,root):
dq = collections.deque([root])
while dq:
node = dq.popleft()
if node.val != root.val:
return False
dq.extend([n for n in (node.left, node.right) if n... | 247 | 2 | 48 |
049d9ad4ca2402feea328d86129e85652cac6d8f | 12,625 | py | Python | rgd/geodata/models/common.py | venkatabhishek/ResonantGeoData | 4e946e25c194874c22f4ba2ab49d6f0cf803e673 | [
"Apache-2.0"
] | null | null | null | rgd/geodata/models/common.py | venkatabhishek/ResonantGeoData | 4e946e25c194874c22f4ba2ab49d6f0cf803e673 | [
"Apache-2.0"
] | null | null | null | rgd/geodata/models/common.py | venkatabhishek/ResonantGeoData | 4e946e25c194874c22f4ba2ab49d6f0cf803e673 | [
"Apache-2.0"
] | null | null | null | import contextlib
import logging
import os
from urllib.error import URLError
from urllib.parse import urlencode, urlparse
# from django.contrib.auth import get_user_model
from django.contrib.gis.db import models
from django.core.exceptions import ObjectDoesNotExist
from django.utils import timezone
from girder_utils.f... | 34.972299 | 145 | 0.620277 | import contextlib
import logging
import os
from urllib.error import URLError
from urllib.parse import urlencode, urlparse
# from django.contrib.auth import get_user_model
from django.contrib.gis.db import models
from django.core.exceptions import ObjectDoesNotExist
from django.utils import timezone
from girder_utils.f... | 2,922 | 849 | 314 |
7e16de0aa3cf48c1190b720bbb78c8f0c466d307 | 298 | py | Python | ProyectoFinal/usuarios/forms.py | PredadorAkrid/IS-2020-2-La-Orden-De-Turing | cc292723a7bc4e4c1f848d00484f62ac75e7ad20 | [
"Apache-2.0"
] | null | null | null | ProyectoFinal/usuarios/forms.py | PredadorAkrid/IS-2020-2-La-Orden-De-Turing | cc292723a7bc4e4c1f848d00484f62ac75e7ad20 | [
"Apache-2.0"
] | null | null | null | ProyectoFinal/usuarios/forms.py | PredadorAkrid/IS-2020-2-La-Orden-De-Turing | cc292723a7bc4e4c1f848d00484f62ac75e7ad20 | [
"Apache-2.0"
] | null | null | null | """Users forms."""
# Django
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import authenticate
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from .models import *
| 29.8 | 74 | 0.822148 | """Users forms."""
# Django
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import authenticate
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from .models import *
| 0 | 0 | 0 |
e52ef64aa93903e8fe0e6fd02b45411a68393dd3 | 1,557 | py | Python | examples/maoyan_comments.py | alphardex/looter | 2be094576e31fd13123719ca94e42cb31475dffa | [
"MIT"
] | 145 | 2018-02-25T13:59:52.000Z | 2021-12-11T17:13:36.000Z | examples/maoyan_comments.py | alphardex/crawltools | 2be094576e31fd13123719ca94e42cb31475dffa | [
"MIT"
] | 7 | 2018-03-26T01:53:44.000Z | 2021-03-31T18:59:12.000Z | examples/maoyan_comments.py | alphardex/crawltools | 2be094576e31fd13123719ca94e42cb31475dffa | [
"MIT"
] | 25 | 2018-03-26T14:16:53.000Z | 2021-10-14T12:32:21.000Z | """
猫眼电影影评,以复联4为例,先把时间节点都爬下来,再组合成url用线程池爬,这样效率更高
"""
import arrow
import requests
import looter as lt
from pprint import pprint
from pathlib import Path
from concurrent import futures
domain = 'http://m.maoyan.com'
movie_id = '248172' # 复仇者联盟4
total_timestamps = []
total_items = []
if __name__ == '__main__':
... | 33.12766 | 116 | 0.675658 | """
猫眼电影影评,以复联4为例,先把时间节点都爬下来,再组合成url用线程池爬,这样效率更高
"""
import arrow
import requests
import looter as lt
from pprint import pprint
from pathlib import Path
from concurrent import futures
domain = 'http://m.maoyan.com'
movie_id = '248172' # 复仇者联盟4
total_timestamps = []
total_items = []
def get_timestamps():
start_t... | 842 | 0 | 46 |
445c6bd811b5cf3a6576bc280c446ae6d443c5f9 | 1,453 | py | Python | tardis/rest/token_generator/generate_token.py | maxfischer2781/tardis | a83ba0a02d2f153a8ab95b84ec78bc6ababa57a5 | [
"MIT"
] | 4 | 2018-05-22T13:22:06.000Z | 2019-03-26T15:32:57.000Z | tardis/rest/token_generator/generate_token.py | maxfischer2781/tardis | a83ba0a02d2f153a8ab95b84ec78bc6ababa57a5 | [
"MIT"
] | 50 | 2018-05-18T11:46:39.000Z | 2019-04-26T07:29:45.000Z | tardis/rest/token_generator/generate_token.py | maxfischer2781/tardis | a83ba0a02d2f153a8ab95b84ec78bc6ababa57a5 | [
"MIT"
] | 2 | 2018-12-12T13:15:59.000Z | 2018-12-17T08:18:15.000Z | from ..app.security import create_access_token
from ...utilities.utils import disable_logging
from cobald.daemon.core.config import load
from pathlib import Path
from typing import List
import logging
import typer
| 33.022727 | 88 | 0.655884 | from ..app.security import create_access_token
from ...utilities.utils import disable_logging
from cobald.daemon.core.config import load
from pathlib import Path
from typing import List
import logging
import typer
def generate_token(
user_name: str = typer.Option(
..., help="User name to include in the g... | 1,214 | 0 | 23 |
17cc95892cb3b5d781ec86c8b5d5211b62136d86 | 4,702 | py | Python | version0.1 220618/mainWindow.py | grey-wings/dynamic_desktop | a58ef6109112bd89fde24e0ca7bf7ecefc51cc8d | [
"MIT"
] | null | null | null | version0.1 220618/mainWindow.py | grey-wings/dynamic_desktop | a58ef6109112bd89fde24e0ca7bf7ecefc51cc8d | [
"MIT"
] | null | null | null | version0.1 220618/mainWindow.py | grey-wings/dynamic_desktop | a58ef6109112bd89fde24e0ca7bf7ecefc51cc8d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainWindow.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import... | 53.431818 | 140 | 0.700553 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainWindow.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import... | 4,237 | 7 | 81 |
dece24142176f48a8615f89b1d26ade61c158613 | 964 | py | Python | k_medoids/k-medoids.py | vishalbpatil1/k-medoids | 84ebf0205247bf4af1debb431fdcc85f3af08652 | [
"MIT"
] | null | null | null | k_medoids/k-medoids.py | vishalbpatil1/k-medoids | 84ebf0205247bf4af1debb431fdcc85f3af08652 | [
"MIT"
] | 1 | 2021-09-04T14:12:39.000Z | 2021-09-04T14:12:39.000Z | k_medoids/k-medoids.py | vishalbpatil1/k-medoids | 84ebf0205247bf4af1debb431fdcc85f3af08652 | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.metrics.pairwise import manhattan_distances as dist
| 26.054054 | 102 | 0.577801 | import numpy as np
from sklearn.metrics.pairwise import manhattan_distances as dist
def int_medoids(x,k):
a=[]
for j in range(k):
r1=np.random.choice(range(1,len(x)))
m=x[(r1),:]
a.append(m)
int_mediods=np.array(a)
return int_mediods
def K_medoids_min_cost(... | 797 | 0 | 75 |
31c3bebf030c53139de2d6d2e0e1ef312f7947bd | 2,388 | py | Python | net/client/examples/apod.py | juandesant/astrometry.net | 47849f0443b890c4a875360f881d2e60d1cba630 | [
"Net-SNMP",
"Xnet"
] | 460 | 2015-01-06T13:20:04.000Z | 2022-03-29T00:37:55.000Z | net/client/examples/apod.py | juandesant/astrometry.net | 47849f0443b890c4a875360f881d2e60d1cba630 | [
"Net-SNMP",
"Xnet"
] | 208 | 2015-01-08T20:26:38.000Z | 2022-03-25T15:21:34.000Z | net/client/examples/apod.py | juandesant/astrometry.net | 47849f0443b890c4a875360f881d2e60d1cba630 | [
"Net-SNMP",
"Xnet"
] | 173 | 2015-01-08T18:01:54.000Z | 2022-03-27T07:27:04.000Z | # Copyright 2011 David W. Hogg.
# All rights reserved.
# BUGS:
# - Brittle code; must be run from directory client/examples; dies if APOD reformats urls or html.
# - Runs client using os.system() instead of importing client and executing it; see if False block at end.
from __future__ import print_function
import re
i... | 35.641791 | 125 | 0.597152 | # Copyright 2011 David W. Hogg.
# All rights reserved.
# BUGS:
# - Brittle code; must be run from directory client/examples; dies if APOD reformats urls or html.
# - Runs client using os.system() instead of importing client and executing it; see if False block at end.
from __future__ import print_function
import re
i... | 380 | 0 | 69 |
c55d1f130e3125cda04302fb71d6ebf4e4c2944f | 1,841 | py | Python | Project_Tuples/listOfAllKeys.py | zacandcheese/Keyboard-Biometric-Project | 0cdc0fef65b34624e80a5e96e2457c9cf958fb6d | [
"MIT"
] | 1 | 2017-10-03T14:40:09.000Z | 2017-10-03T14:40:09.000Z | Project_Tuples/listOfAllKeys.py | zacandcheese/Keyboard-Biometric-Project | 0cdc0fef65b34624e80a5e96e2457c9cf958fb6d | [
"MIT"
] | null | null | null | Project_Tuples/listOfAllKeys.py | zacandcheese/Keyboard-Biometric-Project | 0cdc0fef65b34624e80a5e96e2457c9cf958fb6d | [
"MIT"
] | 2 | 2019-02-20T02:28:13.000Z | 2021-12-01T19:50:19.000Z | #[port, char]
nameDict = dict([(65, 'A'),(66, 'B'),(67, 'C'),(68, 'D'), (69, 'E'), (70, 'F'),(71, 'G'), (72, 'H'),(73, 'I'),(74, 'J'),(75, 'K'),(76, 'L'),
(77, 'M'),(78, 'N'),(79, 'O'),(80, 'P'),(81, 'Q'),(82, 'R'),(83, 'S'),(84, 'T'),(85, 'U'),(86, 'V'),(87, 'W'),(88, 'X'),(89, 'Y'),(90, 'Z'),
(97, 'a'),(98, 'b'),(99,... | 108.294118 | 158 | 0.380771 | #[port, char]
nameDict = dict([(65, 'A'),(66, 'B'),(67, 'C'),(68, 'D'), (69, 'E'), (70, 'F'),(71, 'G'), (72, 'H'),(73, 'I'),(74, 'J'),(75, 'K'),(76, 'L'),
(77, 'M'),(78, 'N'),(79, 'O'),(80, 'P'),(81, 'Q'),(82, 'R'),(83, 'S'),(84, 'T'),(85, 'U'),(86, 'V'),(87, 'W'),(88, 'X'),(89, 'Y'),(90, 'Z'),
(97, 'a'),(98, 'b'),(99,... | 0 | 0 | 0 |
0c63b787a42f93b6ef7034c610e36d7d8c1b3163 | 6,970 | py | Python | get-metrics-insights.py | sbecker11/RetrievePowerAndPerformanceMetricsAndLogInsights | 78b83bb75065165d1687de67441c9c19804c57e1 | [
"MIT"
] | null | null | null | get-metrics-insights.py | sbecker11/RetrievePowerAndPerformanceMetricsAndLogInsights | 78b83bb75065165d1687de67441c9c19804c57e1 | [
"MIT"
] | null | null | null | get-metrics-insights.py | sbecker11/RetrievePowerAndPerformanceMetricsAndLogInsights | 78b83bb75065165d1687de67441c9c19804c57e1 | [
"MIT"
] | null | null | null | """
See README.md for help configuring and running this script.
"""
import os
import sys
import datetime
from urllib.parse import urlparse
import http.client
import json
import jwt
from dotenv import load_dotenv
########
# KEY CONFIGURATION - Put your API Key info here
# added on 2021-12-08 by shawn.becker@angel.com... | 33.671498 | 114 | 0.595265 | """
See README.md for help configuring and running this script.
"""
import os
import sys
import datetime
from urllib.parse import urlparse
import http.client
import json
import jwt
from dotenv import load_dotenv
########
# KEY CONFIGURATION - Put your API Key info here
# added on 2021-12-08 by shawn.becker@angel.com... | 1,048 | 0 | 114 |
543db429674f347f446e727454c481cff4c34a5c | 5,331 | py | Python | src/service/user.py | Cassianokunsch/unfollow-app-graphene | ebea586ec1a971f08aa060b1daf51a4f916066d2 | [
"MIT"
] | null | null | null | src/service/user.py | Cassianokunsch/unfollow-app-graphene | ebea586ec1a971f08aa060b1daf51a4f916066d2 | [
"MIT"
] | 12 | 2020-05-01T15:32:46.000Z | 2022-03-12T00:14:30.000Z | src/service/user.py | Cassianokunsch/unfollow-app-graphene | ebea586ec1a971f08aa060b1daf51a4f916066d2 | [
"MIT"
] | null | null | null | from graphql import GraphQLError
from shared.messages import UNKNOW_ERROR, TOO_MANY_REQUESTS, UNFOLLOW_SUCCESS, UNFOLLOW_ERROR, FOLLOW_SUCCESS, FOLLOW_ERROR
from resolvers.types.user_info import UserInfo
from resolvers.types.picture import Picture
from resolvers.types.feed import Feed
from storage.session import get_se... | 29.949438 | 123 | 0.633089 | from graphql import GraphQLError
from shared.messages import UNKNOW_ERROR, TOO_MANY_REQUESTS, UNFOLLOW_SUCCESS, UNFOLLOW_ERROR, FOLLOW_SUCCESS, FOLLOW_ERROR
from resolvers.types.user_info import UserInfo
from resolvers.types.picture import Picture
from resolvers.types.feed import Feed
from storage.session import get_se... | 4,722 | 0 | 207 |
a06b9193506ca5bc580e08e2b908b1f7b82a1349 | 2,496 | py | Python | rewrite/commands/owner/reload.py | VoxelPrismatic/prizai | 632a5dfed23807d78064d292d474ac4cc8988b12 | [
"Unlicense"
] | 2 | 2019-11-08T21:34:44.000Z | 2020-07-05T15:31:19.000Z | rewrite/commands/owner/reload.py | VoxelPrismatic/prizai | 632a5dfed23807d78064d292d474ac4cc8988b12 | [
"Unlicense"
] | null | null | null | rewrite/commands/owner/reload.py | VoxelPrismatic/prizai | 632a5dfed23807d78064d292d474ac4cc8988b12 | [
"Unlicense"
] | 2 | 2020-07-05T15:39:51.000Z | 2020-07-05T16:15:47.000Z | import importlib
import traceback
info = {
"name": "reload",
"type": 1,
"description": "Reloads a command",
"id": "reload",
"options": [
{
"name": "command",
"description": "Command name",
"type": 3,
"required": True
},
{
... | 29.714286 | 138 | 0.437099 | import importlib
import traceback
info = {
"name": "reload",
"type": 1,
"description": "Reloads a command",
"id": "reload",
"options": [
{
"name": "command",
"description": "Command name",
"type": 3,
"required": True
},
{
... | 1,974 | 0 | 23 |
9dc88e47e2d3e1e58965a94cd2edb8efa42f7624 | 1,428 | py | Python | tests/test_aio_clients.py | nikolai-semenov/voicekit_client_python | 208cb615a00585e926e558617bf12a1f79d55e9f | [
"Apache-2.0"
] | 19 | 2020-01-14T12:49:53.000Z | 2021-12-22T11:34:22.000Z | tests/test_aio_clients.py | nikolai-semenov/voicekit_client_python | 208cb615a00585e926e558617bf12a1f79d55e9f | [
"Apache-2.0"
] | 1 | 2021-07-26T22:09:55.000Z | 2021-07-26T22:09:55.000Z | tests/test_aio_clients.py | nikolai-semenov/voicekit_client_python | 208cb615a00585e926e558617bf12a1f79d55e9f | [
"Apache-2.0"
] | 7 | 2020-05-07T17:38:50.000Z | 2021-07-26T16:28:45.000Z | import time
import pytest
from tinkoff_voicekit_client import user_utils
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
| 30.382979 | 111 | 0.745798 | import time
import pytest
from tinkoff_voicekit_client import user_utils
@pytest.mark.asyncio
async def test_aio_recognize(aio_client_stt, audio_data):
response, meta = await aio_client_stt.recognize(
audio_data["source"], audio_data["config"], with_response_meta=True
)
print(response)
print... | 1,186 | 0 | 88 |
378a83320711e490f8b9c743f8de3a53cb5956fa | 1,329 | py | Python | 21.py | smahs/euler-py | d8855d8db7336ebcdb38e8841aab6a379b766f0d | [
"MIT"
] | null | null | null | 21.py | smahs/euler-py | d8855d8db7336ebcdb38e8841aab6a379b766f0d | [
"MIT"
] | null | null | null | 21.py | smahs/euler-py | d8855d8db7336ebcdb38e8841aab6a379b766f0d | [
"MIT"
] | null | null | null | #!/usr/bin/python2
"""
Statement:
Let d(n) be defined as the sum of proper divisors of n
(numbers less than n which divide evenly into n).
If d(a) = b and d(b) = a, where a != b, then a and b are an amicable
pair and each of a and b are called amicable numbers.
For example, the proper divisors of 220 are 1, 2, 4, 5,... | 23.732143 | 68 | 0.617005 | #!/usr/bin/python2
"""
Statement:
Let d(n) be defined as the sum of proper divisors of n
(numbers less than n which divide evenly into n).
If d(a) = b and d(b) = a, where a != b, then a and b are an amicable
pair and each of a and b are called amicable numbers.
For example, the proper divisors of 220 are 1, 2, 4, 5,... | 520 | 12 | 181 |
1827f102ef295c7fbae77050c35f642af3828beb | 934 | py | Python | api/environments/management/commands/migrate_to_edge.py | ekampf/flagsmith | 35d1944de9763f02de5d5d1793d5b29b7fe28993 | [
"BSD-3-Clause"
] | null | null | null | api/environments/management/commands/migrate_to_edge.py | ekampf/flagsmith | 35d1944de9763f02de5d5d1793d5b29b7fe28993 | [
"BSD-3-Clause"
] | null | null | null | api/environments/management/commands/migrate_to_edge.py | ekampf/flagsmith | 35d1944de9763f02de5d5d1793d5b29b7fe28993 | [
"BSD-3-Clause"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
from environments.dynamodb import DynamoIdentityWrapper
| 33.357143 | 91 | 0.642398 | from django.core.management.base import BaseCommand, CommandError
from environments.dynamodb import DynamoIdentityWrapper
class Command(BaseCommand):
help = "Migrate Identity Data to Dynamo db"
def add_arguments(self, parser):
parser.add_argument(
"project", type=int, help="Id of the pro... | 679 | 108 | 23 |
6f9bdc4f72a08cdb667640b7246292f6f915e44c | 358 | py | Python | naughty.py | santa-shares/santa-shares-server | b3edd1e486337bc9fd0f853fca89db4280473f6c | [
"MIT"
] | null | null | null | naughty.py | santa-shares/santa-shares-server | b3edd1e486337bc9fd0f853fca89db4280473f6c | [
"MIT"
] | 1 | 2019-12-13T23:06:50.000Z | 2019-12-13T23:06:50.000Z | naughty.py | santa-shares/santa-shares-server | b3edd1e486337bc9fd0f853fca89db4280473f6c | [
"MIT"
] | 3 | 2019-12-13T22:47:00.000Z | 2019-12-22T11:42:29.000Z | from extensions import db
from app import app
from models import User
with app.app_context():
jon = User.query.filter_by(id=7).first()
jon.balance += 1800_00
storage = User.query.filter_by(id=11).first()
storage.balance -= 10000_00
alasdair = User.query.filter_by(id=10).first()
alasdair.balan... | 23.866667 | 50 | 0.698324 | from extensions import db
from app import app
from models import User
with app.app_context():
jon = User.query.filter_by(id=7).first()
jon.balance += 1800_00
storage = User.query.filter_by(id=11).first()
storage.balance -= 10000_00
alasdair = User.query.filter_by(id=10).first()
alasdair.balan... | 0 | 0 | 0 |
5b9cd648c24496759f334168440276de21ee1b24 | 3,218 | py | Python | fitfast/layer_optimizer.py | aayux/fitfast | f14e0ef3e5e8acd961957c6b537f89961b0f6b40 | [
"Apache-2.0"
] | null | null | null | fitfast/layer_optimizer.py | aayux/fitfast | f14e0ef3e5e8acd961957c6b537f89961b0f6b40 | [
"Apache-2.0"
] | null | null | null | fitfast/layer_optimizer.py | aayux/fitfast | f14e0ef3e5e8acd961957c6b537f89961b0f6b40 | [
"Apache-2.0"
] | null | null | null | from .imports import *
from .utils.core import *
from .utils.extras import *
# why is this different?
| 34.234043 | 80 | 0.60752 | from .imports import *
from .utils.core import *
from .utils.extras import *
def optimizer_params(params, lr, wd):
return {'params': chain_params(params),
'lr': lr,
'wd': wd}
class LayerOptimizer(object):
def __init__(self, optimizer, layer_groups, lrs, wds=None):
if not isins... | 2,662 | 313 | 137 |
f89498ebc16d22aa8c39567fe526726358d57c6d | 117 | py | Python | urwid/__init__.py | mingz2013/terminal-ui-demo | 0737b03ce49a4e50227795305a93b186386ba754 | [
"Apache-2.0"
] | null | null | null | urwid/__init__.py | mingz2013/terminal-ui-demo | 0737b03ce49a4e50227795305a93b186386ba754 | [
"Apache-2.0"
] | null | null | null | urwid/__init__.py | mingz2013/terminal-ui-demo | 0737b03ce49a4e50227795305a93b186386ba754 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@FileName: __init__.py
@Time: 2020/7/18 11:10
@Author: zhaojm
Module Description
"""
| 9.75 | 23 | 0.615385 | # -*- coding: utf-8 -*-
"""
@FileName: __init__.py
@Time: 2020/7/18 11:10
@Author: zhaojm
Module Description
"""
| 0 | 0 | 0 |
63662d1c60805cc30b7e149d591a72e43856916b | 22,171 | py | Python | src/firebolt_cli/engine.py | firebolt-db/firebolt-cli | 6ca12722646d2a7a0f0abb1664d5eb48076354ed | [
"Apache-2.0"
] | 1 | 2022-03-09T18:57:43.000Z | 2022-03-09T18:57:43.000Z | src/firebolt_cli/engine.py | firebolt-db/firebolt-cli | 6ca12722646d2a7a0f0abb1664d5eb48076354ed | [
"Apache-2.0"
] | 23 | 2022-02-15T09:49:38.000Z | 2022-03-21T13:20:18.000Z | src/firebolt_cli/engine.py | firebolt-db/firebolt-cli | 6ca12722646d2a7a0f0abb1664d5eb48076354ed | [
"Apache-2.0"
] | 1 | 2022-03-18T08:37:35.000Z | 2022-03-18T08:37:35.000Z | import os
import sys
from datetime import timedelta
from typing import Callable, Optional
from click import (
Choice,
IntRange,
argument,
command,
confirm,
echo,
group,
option,
)
from firebolt.common.exception import FireboltError
from firebolt.model.engine import Engine
from firebolt.s... | 30.665284 | 88 | 0.641108 | import os
import sys
from datetime import timedelta
from typing import Callable, Optional
from click import (
Choice,
IntRange,
argument,
command,
confirm,
echo,
group,
option,
)
from firebolt.common.exception import FireboltError
from firebolt.model.engine import Engine
from firebolt.s... | 1,713 | 0 | 50 |
dcc52f260bab6ad846a1b57a5a7c627824d7a1e2 | 1,178 | py | Python | app/config/settings/staging.py | dxw/nhx-website | 88344c7602823e0b371d3c6f933aa24aeb57db16 | [
"MIT"
] | 50 | 2019-04-04T17:50:00.000Z | 2021-08-05T15:08:37.000Z | app/config/settings/staging.py | dxw/nhx-website | 88344c7602823e0b371d3c6f933aa24aeb57db16 | [
"MIT"
] | 434 | 2019-04-04T18:25:32.000Z | 2022-03-31T18:23:37.000Z | app/config/settings/staging.py | nhsx-mirror/nhsx-website | 2133b4e275ca35ff77f7d6874e809f139ec4bf86 | [
"MIT"
] | 23 | 2019-04-04T09:52:07.000Z | 2021-04-11T07:41:47.000Z | import os
from .remote import * # NOQA
from .base import MEDIA_ROOT, BASE_DIR # NOQA
DEBUG = False
WAGTAIL_CACHE = False
BASE_URL = "https://web.staging.nhsx-website.dalmatian.dxw.net"
MIDDLEWARE += ["baipw.middleware.BasicAuthIPWhitelistMiddleware"]
BASIC_AUTH_LOGIN = os.environ.get("BASIC_AUTH_LOGIN", "")
BASIC_... | 36.8125 | 100 | 0.503396 | import os
from .remote import * # NOQA
from .base import MEDIA_ROOT, BASE_DIR # NOQA
DEBUG = False
WAGTAIL_CACHE = False
BASE_URL = "https://web.staging.nhsx-website.dalmatian.dxw.net"
MIDDLEWARE += ["baipw.middleware.BasicAuthIPWhitelistMiddleware"]
BASIC_AUTH_LOGIN = os.environ.get("BASIC_AUTH_LOGIN", "")
BASIC_... | 0 | 0 | 0 |
ce3f4d54a285714fddc11227ffc83bf10e6dcf6b | 21,862 | py | Python | src/kolibri_daemon/application.py | endlessm/kolibri-installer-gnome | 2cc0800269a998774a60abb71455a72eb360b18c | [
"MIT"
] | null | null | null | src/kolibri_daemon/application.py | endlessm/kolibri-installer-gnome | 2cc0800269a998774a60abb71455a72eb360b18c | [
"MIT"
] | 2 | 2021-12-23T14:54:16.000Z | 2022-03-22T00:36:06.000Z | src/kolibri_daemon/application.py | endlessm/kolibri-installer-gnome | 2cc0800269a998774a60abb71455a72eb360b18c | [
"MIT"
] | null | null | null | from __future__ import annotations
import time
import typing
from concurrent.futures import Future
from functools import partial
from uuid import uuid4
from gi.repository import Gio
from gi.repository import GLib
from gi.repository import KolibriDaemonDBus
from kolibri_app.config import DAEMON_APPLICATION_ID
from kol... | 34.756757 | 88 | 0.682463 | from __future__ import annotations
import time
import typing
from concurrent.futures import Future
from functools import partial
from uuid import uuid4
from gi.repository import Gio
from gi.repository import GLib
from gi.repository import KolibriDaemonDBus
from kolibri_app.config import DAEMON_APPLICATION_ID
from kol... | 17,855 | 3,010 | 115 |
c280fa57467d137ac3c7ee8ddcdb4f4bca41c869 | 22,559 | py | Python | networking_brocade/vdx/ml2driver/nos/nctemplates.py | dariko/networking-brocade | c5f3fd8cd0a88e01eeea6228646a72d0b12fa9d5 | [
"Apache-2.0"
] | null | null | null | networking_brocade/vdx/ml2driver/nos/nctemplates.py | dariko/networking-brocade | c5f3fd8cd0a88e01eeea6228646a72d0b12fa9d5 | [
"Apache-2.0"
] | null | null | null | networking_brocade/vdx/ml2driver/nos/nctemplates.py | dariko/networking-brocade | c5f3fd8cd0a88e01eeea6228646a72d0b12fa9d5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 Brocade Communications Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | 36.210273 | 86 | 0.534421 | # Copyright (c) 2014 Brocade Communications Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | 0 | 0 | 0 |
68bd39af2f1c0550c544c64c3cf6b11db56420ba | 1,182 | py | Python | src/calculators/test/data/Iterpose_Fit_CA/Iterpose_Fit_CA.py | LongxingCao/pyRMSD | 856b72a0dddd579430b2e87bdb026d71fbf9d250 | [
"MIT"
] | 1 | 2021-02-18T19:15:58.000Z | 2021-02-18T19:15:58.000Z | src/calculators/test/data/Iterpose_Fit_CA/Iterpose_Fit_CA.py | LongxingCao/pyRMSD | 856b72a0dddd579430b2e87bdb026d71fbf9d250 | [
"MIT"
] | null | null | null | src/calculators/test/data/Iterpose_Fit_CA/Iterpose_Fit_CA.py | LongxingCao/pyRMSD | 856b72a0dddd579430b2e87bdb026d71fbf9d250 | [
"MIT"
] | 2 | 2020-12-11T14:57:48.000Z | 2021-08-03T12:22:44.000Z | import prody
import numpy
pdb_data = prody.parsePDB("../Models/prot_stretching/stretching_trajectory_offset_ligand.pdb")
pdb_trajectory = prody.PDBEnsemble("iterposed_CA")
# Write the initial coordsets
prot = pdb_data.select("name CA")
prody.writePDB("stretching_trajectory_offset_ligand.iterposed_all.pdb", prot)
with... | 42.214286 | 94 | 0.78934 | import prody
import numpy
pdb_data = prody.parsePDB("../Models/prot_stretching/stretching_trajectory_offset_ligand.pdb")
pdb_trajectory = prody.PDBEnsemble("iterposed_CA")
# Write the initial coordsets
prot = pdb_data.select("name CA")
prody.writePDB("stretching_trajectory_offset_ligand.iterposed_all.pdb", prot)
with... | 0 | 0 | 0 |
cab23e3fd6da49bea69a9c1cd52c359d14056486 | 2,290 | py | Python | src/engine.py | jf20541/Pruning-DeepNeuralNetwork | a78a88616c19aa0f1449eb562b7dd8d7c4f47252 | [
"MIT"
] | null | null | null | src/engine.py | jf20541/Pruning-DeepNeuralNetwork | a78a88616c19aa0f1449eb562b7dd8d7c4f47252 | [
"MIT"
] | null | null | null | src/engine.py | jf20541/Pruning-DeepNeuralNetwork | a78a88616c19aa0f1449eb562b7dd8d7c4f47252 | [
"MIT"
] | null | null | null | import torch
| 35.78125 | 89 | 0.564629 | import torch
class Engine:
def __init__(self, model, optimizer):
self.model = model
self.optimizer = optimizer
def loss_fn(self, outputs, targets):
""" Computes the cross entropy loss between input and target.
Training a classification problem with 10 classes.
"""
... | 78 | 2,175 | 23 |
ed3b74a117dc5d8feb1b04d7188ea9128542e89d | 4,634 | py | Python | reader/fnoData/idxOptDailyDataWrapper.py | sifarone/gce_k8s_deployment | f596e17b9d0263ae24c61ebba9925af4719b4306 | [
"MIT"
] | null | null | null | reader/fnoData/idxOptDailyDataWrapper.py | sifarone/gce_k8s_deployment | f596e17b9d0263ae24c61ebba9925af4719b4306 | [
"MIT"
] | null | null | null | reader/fnoData/idxOptDailyDataWrapper.py | sifarone/gce_k8s_deployment | f596e17b9d0263ae24c61ebba9925af4719b4306 | [
"MIT"
] | 1 | 2021-01-24T17:07:37.000Z | 2021-01-24T17:07:37.000Z | from . import fnoUtils as utils | 48.270833 | 95 | 0.645878 | from . import fnoUtils as utils
class IdxOptDailyDataWrapper:
def __init__(self, dailyData):
self.date = utils.convertDateToString(dailyData['date'])
self.idxOptOpenPrice = dailyData['idxOptOpenPrice']
self.idxOptHighPrice = dailyData[... | 4,168 | 8 | 427 |
bf4a7fd0ea942fa85823c7159145fc1fffbab324 | 1,994 | py | Python | djauth/bin/student_staff.py | carthagecollege/django-djauth | 3ef7b7ad80ff0361a3eff662bfd15f356df65ad2 | [
"BSD-3-Clause"
] | null | null | null | djauth/bin/student_staff.py | carthagecollege/django-djauth | 3ef7b7ad80ff0361a3eff662bfd15f356df65ad2 | [
"BSD-3-Clause"
] | 8 | 2020-06-05T19:21:15.000Z | 2022-01-25T16:42:01.000Z | djauth/bin/student_staff.py | carthagecollege/django-djauth | 3ef7b7ad80ff0361a3eff662bfd15f356df65ad2 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
import django
import os
import sys
# env
sys.path.append('/usr/lib/python2.7/dist-packages/')
sys.path.append('/usr/lib/python2.7/')
sys.path.append('/usr/local/lib/python2.7/dist-packages/')
sys.path.append('/data2/django_1.9/')
sys.path.append('/data2/django_projects/')
sys.pat... | 26.945946 | 75 | 0.597292 | # -*- coding: utf-8 -*-
import datetime
import django
import os
import sys
# env
sys.path.append('/usr/lib/python2.7/dist-packages/')
sys.path.append('/usr/lib/python2.7/')
sys.path.append('/usr/local/lib/python2.7/dist-packages/')
sys.path.append('/data2/django_1.9/')
sys.path.append('/data2/django_projects/')
sys.pat... | 0 | 0 | 0 |
4fc7736d0ba93e1e8dcea1380c832eb410972ab5 | 2,027 | py | Python | tests/test_metabase.py | chasleslr/metabase-python | 17dc371c665b6e81b175df4bf4f688807dcf3613 | [
"MIT"
] | null | null | null | tests/test_metabase.py | chasleslr/metabase-python | 17dc371c665b6e81b175df4bf4f688807dcf3613 | [
"MIT"
] | 30 | 2021-11-21T04:48:12.000Z | 2022-03-12T22:43:23.000Z | tests/test_metabase.py | chasleslr/metabase-python | 17dc371c665b6e81b175df4bf4f688807dcf3613 | [
"MIT"
] | null | null | null | from unittest import TestCase
from metabase.exceptions import AuthenticationError
from metabase.metabase import Metabase
from tests.helpers import IntegrationTestCase
| 33.229508 | 102 | 0.652195 | from unittest import TestCase
from metabase.exceptions import AuthenticationError
from metabase.metabase import Metabase
from tests.helpers import IntegrationTestCase
class MetabaseTests(TestCase):
def test_host(self):
"""Ensure Metabase.host adds https:// and trims trailing /."""
metabase = Meta... | 108 | 1,703 | 46 |
60c3ecf6777c2824a4d9a06a69f903e82df8c94b | 726 | py | Python | 00_Code/01_LeetCode/389_FindtheDifference.py | KartikKannapur/Data_Structures_and_Algorithms_Python | 66e3c8112826aeffb78bd74d02be1a8d1e478de8 | [
"MIT"
] | 1 | 2017-06-11T04:57:07.000Z | 2017-06-11T04:57:07.000Z | 00_Code/01_LeetCode/389_FindtheDifference.py | KartikKannapur/Data_Structures_and_Algorithms_Python | 66e3c8112826aeffb78bd74d02be1a8d1e478de8 | [
"MIT"
] | null | null | null | 00_Code/01_LeetCode/389_FindtheDifference.py | KartikKannapur/Data_Structures_and_Algorithms_Python | 66e3c8112826aeffb78bd74d02be1a8d1e478de8 | [
"MIT"
] | null | null | null | """
Given two strings s and t which consist of only lowercase letters.
String t is generated by random shuffling string s and then add one more letter at a random position.
Find the letter that was added in t.
Example:
Input:
s = "abcd"
t = "abcde"
Output:
e
Explanation:
'e' is the letter that was added.
Your ru... | 16.883721 | 101 | 0.581267 | """
Given two strings s and t which consist of only lowercase letters.
String t is generated by random shuffling string s and then add one more letter at a random position.
Find the letter that was added in t.
Example:
Input:
s = "abcd"
t = "abcde"
Output:
e
Explanation:
'e' is the letter that was added.
Your ru... | 0 | 335 | 23 |
b7236de46421cb3772f9bb9212a50a79f2bbe26c | 2,896 | py | Python | tests/test_parser_params.py | bitranox/Arpeggio | 62151cb8ef2cfe5113a4388da09892e7714c5e96 | [
"MIT"
] | null | null | null | tests/test_parser_params.py | bitranox/Arpeggio | 62151cb8ef2cfe5113a4388da09892e7714c5e96 | [
"MIT"
] | null | null | null | tests/test_parser_params.py | bitranox/Arpeggio | 62151cb8ef2cfe5113a4388da09892e7714c5e96 | [
"MIT"
] | null | null | null | #######################################################################
# Name: test_parser_params
# Purpose: Test for parser parameters.
# Author: Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com>
# Copyright: (c) 2014 Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com>
# License: MIT License
###############... | 26.327273 | 77 | 0.604972 | #######################################################################
# Name: test_parser_params
# Purpose: Test for parser parameters.
# Author: Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com>
# Copyright: (c) 2014 Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com>
# License: MIT License
###############... | 128 | 0 | 107 |
e009496fe83606924d8ea4d7622b10d3ea0513f9 | 195 | py | Python | src/yellowdog_client/model/create_keyring_request.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | src/yellowdog_client/model/create_keyring_request.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | src/yellowdog_client/model/create_keyring_request.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from typing import Optional
@dataclass
| 19.5 | 39 | 0.764103 | from dataclasses import dataclass
from typing import Optional
@dataclass
class CreateKeyringRequest:
name: str
description: Optional[str] = None
creatorSecret: Optional[str] = None
| 0 | 98 | 22 |
c95efbb3924fd8fdce68b016664f2c1149f587f3 | 528 | py | Python | polls/tests/conftest.py | sidorenkov-v-a/polls | 84fc0c291b0931216a66e38b02581cd4b4932a53 | [
"MIT"
] | null | null | null | polls/tests/conftest.py | sidorenkov-v-a/polls | 84fc0c291b0931216a66e38b02581cd4b4932a53 | [
"MIT"
] | null | null | null | polls/tests/conftest.py | sidorenkov-v-a/polls | 84fc0c291b0931216a66e38b02581cd4b4932a53 | [
"MIT"
] | null | null | null | import pytest
from django.contrib.auth import get_user_model
from rest_framework.test import APIClient
@pytest.fixture(autouse=True)
@pytest.fixture
@pytest.fixture
| 21.12 | 79 | 0.744318 | import pytest
from django.contrib.auth import get_user_model
from rest_framework.test import APIClient
@pytest.fixture(autouse=True)
def enable_db_access_for_all_tests(db):
pass
@pytest.fixture
def admin_client():
admin = get_user_model().objects.create_superuser(
username='TestUser', email='TestUse... | 291 | 0 | 66 |
021f7eb949236e09c177c7cdea7d98aa2700bf88 | 1,835 | py | Python | tests/acceptance/test_project_overview.py | boblail/sentry | 71127331e58791d4651e480b65dd66f06cadc1c8 | [
"BSD-3-Clause"
] | 1 | 2019-08-28T11:03:13.000Z | 2019-08-28T11:03:13.000Z | tests/acceptance/test_project_overview.py | boblail/sentry | 71127331e58791d4651e480b65dd66f06cadc1c8 | [
"BSD-3-Clause"
] | 1 | 2022-01-15T02:36:18.000Z | 2022-01-15T02:36:18.000Z | tests/acceptance/test_project_overview.py | gaybro8777/sentry | 4594f479db9a079d7f1ed41a9e07d8f36953319f | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import pytz
from datetime import datetime
from django.utils import timezone
from mock import patch
from sentry.testutils import AcceptanceTestCase, SnubaTestCase
| 33.981481 | 74 | 0.633243 | from __future__ import absolute_import
import pytz
from datetime import datetime
from django.utils import timezone
from mock import patch
from sentry.testutils import AcceptanceTestCase, SnubaTestCase
class ProjectOverviewTest(AcceptanceTestCase, SnubaTestCase):
def setUp(self):
super(ProjectOverviewTe... | 1,447 | 160 | 23 |
2f1ecab50b0fb1982a33388d254e0f9ca4138167 | 235 | py | Python | src/ch08/219.py | thejit/pycote | 6ac66e7ade78e146d46f650a00447dd055d44584 | [
"MIT"
] | null | null | null | src/ch08/219.py | thejit/pycote | 6ac66e7ade78e146d46f650a00447dd055d44584 | [
"MIT"
] | null | null | null | src/ch08/219.py | thejit/pycote | 6ac66e7ade78e146d46f650a00447dd055d44584 | [
"MIT"
] | null | null | null | #1로 만들기
x=26
d = [0] * 30001
for i in range(2, x+1):
d[i]=d[i-1]+1
if i%2 == 0:
d[i]=min(d[i],d[i//2]+1)
if i%3 == 0:
d[i]=min(d[i],d[i//3]+1)
if i%5 ==0:
d[i]=min(d[i],d[i//5]+1)
print(d[x])
| 14.6875 | 32 | 0.382979 | #1로 만들기
x=26
d = [0] * 30001
for i in range(2, x+1):
d[i]=d[i-1]+1
if i%2 == 0:
d[i]=min(d[i],d[i//2]+1)
if i%3 == 0:
d[i]=min(d[i],d[i//3]+1)
if i%5 ==0:
d[i]=min(d[i],d[i//5]+1)
print(d[x])
| 0 | 0 | 0 |
6910f32ba6ef90d6481e6afd17defefb855ebd1f | 275 | py | Python | kelner/__init__.py | lunardog/kelner | 6a3cc5bfaaf2d0933234460e7a2736c3e3fa391b | [
"MIT"
] | 24 | 2018-02-21T06:57:05.000Z | 2022-03-31T07:12:10.000Z | kelner/__init__.py | lunardog/kelner | 6a3cc5bfaaf2d0933234460e7a2736c3e3fa391b | [
"MIT"
] | 2 | 2018-07-11T07:13:34.000Z | 2018-08-29T06:18:22.000Z | kelner/__init__.py | lunardog/kelner | 6a3cc5bfaaf2d0933234460e7a2736c3e3fa391b | [
"MIT"
] | 5 | 2018-03-27T07:53:42.000Z | 2018-11-21T15:57:31.000Z | from . import server
from . import client
from . import model
def serve(kelner_model, host="127.0.0.1", port=server.KELNER_PORT):
"""
Serves the loaded kelner_model
"""
k_server = server.KelnerServer(kelner_model)
return k_server.serve_http(host, port)
| 22.916667 | 67 | 0.709091 | from . import server
from . import client
from . import model
def serve(kelner_model, host="127.0.0.1", port=server.KELNER_PORT):
"""
Serves the loaded kelner_model
"""
k_server = server.KelnerServer(kelner_model)
return k_server.serve_http(host, port)
| 0 | 0 | 0 |
adfe0fe10e83303e0cafb5e26e30f2d067a55ac3 | 123 | py | Python | setup.py | sumerc/pycalltrak | ab3417fd0a161a42476558181f0eb4981065f8ec | [
"MIT"
] | 3 | 2019-10-20T17:13:55.000Z | 2020-09-09T00:25:59.000Z | setup.py | sumerc/pycalltrak | ab3417fd0a161a42476558181f0eb4981065f8ec | [
"MIT"
] | null | null | null | setup.py | sumerc/pycalltrak | ab3417fd0a161a42476558181f0eb4981065f8ec | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(name='calltrak',
version='1.0',
py_modules = ['calltrak'],
) | 20.5 | 43 | 0.666667 | from setuptools import setup, find_packages
setup(name='calltrak',
version='1.0',
py_modules = ['calltrak'],
) | 0 | 0 | 0 |
785ed93c9566fe4cd0cf345237d10252101d2bf3 | 1,417 | py | Python | app/testers/bow_classifier_tester.py | mschroederi/DL-sentiment-analysis | 121271ffb57aa6e8d9e53e1e7e33cd083e0fb561 | [
"MIT"
] | null | null | null | app/testers/bow_classifier_tester.py | mschroederi/DL-sentiment-analysis | 121271ffb57aa6e8d9e53e1e7e33cd083e0fb561 | [
"MIT"
] | 4 | 2020-07-30T18:21:28.000Z | 2020-07-30T18:21:57.000Z | app/testers/bow_classifier_tester.py | mschroederi/DL-sentiment-analysis | 121271ffb57aa6e8d9e53e1e7e33cd083e0fb561 | [
"MIT"
] | null | null | null | import pandas as pd
import torch
from torch import nn
from torch.utils.data import DataLoader
from app.data_loading.bow_data_loading import BowMovieSentimentDataset
from app.embeddings.bag_of_words import BagOfWords
from app.models.bow_classifier import BowClassifier
from app.preprocessing.preprocessor import Preproce... | 44.28125 | 101 | 0.738885 | import pandas as pd
import torch
from torch import nn
from torch.utils.data import DataLoader
from app.data_loading.bow_data_loading import BowMovieSentimentDataset
from app.embeddings.bag_of_words import BagOfWords
from app.models.bow_classifier import BowClassifier
from app.preprocessing.preprocessor import Preproce... | 967 | 49 | 23 |
ef5cad86f36be03857a3e8460855b7a2fdf076d3 | 3,609 | py | Python | pyresearch/plot_animation_from_csv.py | tetsuzawa/research-tools | 0c6a820469dbf143fefe5898b01346f493af8a1e | [
"MIT"
] | 1 | 2020-06-17T09:40:33.000Z | 2020-06-17T09:40:33.000Z | pyresearch/plot_animation_from_csv.py | tetsuzawa/research-tools | 0c6a820469dbf143fefe5898b01346f493af8a1e | [
"MIT"
] | 6 | 2020-03-24T18:02:56.000Z | 2021-12-13T20:30:52.000Z | pyresearch/plot_animation_from_csv.py | tetsuzawa/research-tools | 0c6a820469dbf143fefe5898b01346f493af8a1e | [
"MIT"
] | 2 | 2020-02-19T04:28:31.000Z | 2020-06-17T09:40:34.000Z | # encoding: utf-8
import argparse
import pathlib
import matplotlib.pyplot as plt
import pandas as pd
from matplotlib import animation
plt.rcParams['font.family'] = 'IPAPGothic'
plt.rcParams['font.size'] = 11
plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['ytick.direction'] = 'in'
plt.rcParams['xtick.top'] = Tru... | 32.513514 | 111 | 0.541424 | # encoding: utf-8
import argparse
import pathlib
import matplotlib.pyplot as plt
import pandas as pd
from matplotlib import animation
plt.rcParams['font.family'] = 'IPAPGothic'
plt.rcParams['font.size'] = 11
plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['ytick.direction'] = 'in'
plt.rcParams['xtick.top'] = Tru... | 2,886 | 0 | 46 |
e6bb52429434cf404ed3bea2ee98f19ec9bab6ca | 1,648 | py | Python | src/flask_easy/scripts/resources/repository.py | Josephmaclean/flask-easy | 64cb647b0dbcd031cb8d27cc60889e50c959e1ca | [
"MIT"
] | 1 | 2021-12-30T12:25:05.000Z | 2021-12-30T12:25:05.000Z | src/flask_easy/scripts/resources/repository.py | Josephmaclean/flask-easy | 64cb647b0dbcd031cb8d27cc60889e50c959e1ca | [
"MIT"
] | null | null | null | src/flask_easy/scripts/resources/repository.py | Josephmaclean/flask-easy | 64cb647b0dbcd031cb8d27cc60889e50c959e1ca | [
"MIT"
] | null | null | null | """
repository.py
Author: Joseph Maclean Arhin
"""
import os
import click
from jinja2 import Template
from .utils import convert_to_camelcase, remove_suffix, add_to_init
def create_repository(path, name, is_sql=True):
"""
This method creates a repository in the rootdir/repositories
directory with the na... | 25.75 | 83 | 0.685073 | """
repository.py
Author: Joseph Maclean Arhin
"""
import os
import click
from jinja2 import Template
from .utils import convert_to_camelcase, remove_suffix, add_to_init
def create_repository(path, name, is_sql=True):
"""
This method creates a repository in the rootdir/repositories
directory with the na... | 0 | 0 | 0 |
80dcaaa27fcc947c084593e4d776452f7ca8b33d | 748 | py | Python | test/test_config_dict.py | jseppanen/oh_config | 0bcc394802f3a028ed00d8c629a23ff8dbd0ee97 | [
"MIT"
] | null | null | null | test/test_config_dict.py | jseppanen/oh_config | 0bcc394802f3a028ed00d8c629a23ff8dbd0ee97 | [
"MIT"
] | null | null | null | test/test_config_dict.py | jseppanen/oh_config | 0bcc394802f3a028ed00d8c629a23ff8dbd0ee97 | [
"MIT"
] | null | null | null | import math
from oh import ConfigDict
| 17.395349 | 51 | 0.421123 | import math
from oh import ConfigDict
def test_init():
# init from dict
conf = ConfigDict({
"a": 1,
"b": [1, 2, 3],
"c": {
"x": {
"y": 42
}
}
})
assert conf.a == 1
assert conf.b == [1, 2, 3]
assert conf.c.x.y == 42
#... | 638 | 0 | 69 |
47fec1d6ad3ac9d70d08c7f31a23745de5abc2d1 | 2,413 | py | Python | bandeco/utils.py | drakenation/bandeco | 417fbb4efc98c5e36ff08d28bed6b2edf7158a1e | [
"MIT"
] | 1 | 2017-05-15T19:21:31.000Z | 2017-05-15T19:21:31.000Z | bandeco/utils.py | drakenation/bandeco | 417fbb4efc98c5e36ff08d28bed6b2edf7158a1e | [
"MIT"
] | null | null | null | bandeco/utils.py | drakenation/bandeco | 417fbb4efc98c5e36ff08d28bed6b2edf7158a1e | [
"MIT"
] | null | null | null | """
Module with helpful functions for general use.
"""
# Core imports
from datetime import date
from re import sub as regex_sub
from sys import stdout
from sys import stderr
# Project imports
from . import constants
def parse_date(date_string):
"""
Parses a date from a string in DD/MM/YYYY format.
:para... | 29.072289 | 100 | 0.66639 | """
Module with helpful functions for general use.
"""
# Core imports
from datetime import date
from re import sub as regex_sub
from sys import stdout
from sys import stderr
# Project imports
from . import constants
def parse_date(date_string):
"""
Parses a date from a string in DD/MM/YYYY format.
:para... | 0 | 0 | 0 |
751698c06a8bca29798aee0d826921e9e325160f | 705 | py | Python | application/routes/appointment.py | tafowocedric/icarehealthcenterapi | f9c74adc3db1b9b0e2bb0e66d1f7fb2bfffef512 | [
"MIT"
] | null | null | null | application/routes/appointment.py | tafowocedric/icarehealthcenterapi | f9c74adc3db1b9b0e2bb0e66d1f7fb2bfffef512 | [
"MIT"
] | null | null | null | application/routes/appointment.py | tafowocedric/icarehealthcenterapi | f9c74adc3db1b9b0e2bb0e66d1f7fb2bfffef512 | [
"MIT"
] | null | null | null | from fastapi import APIRouter
from application.controller import appointment as AppointmentController
from application.models.schema import appointment as AppointmentSchema
from application.models.schema.utils import SuccessResponse
router = APIRouter(prefix='/appointments', tags=['appointments'])
@router.post("/cr... | 39.166667 | 85 | 0.831206 | from fastapi import APIRouter
from application.controller import appointment as AppointmentController
from application.models.schema import appointment as AppointmentSchema
from application.models.schema.utils import SuccessResponse
router = APIRouter(prefix='/appointments', tags=['appointments'])
@router.post("/cr... | 213 | 0 | 44 |
7074a4f61eddfc8efc87e14d0d62f6e4be3166d5 | 2,137 | py | Python | rdr_service/alembic/versions/6079f2fae734_changing_module_to_not_nullable.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 39 | 2017-10-13T19:16:27.000Z | 2021-09-24T16:58:21.000Z | rdr_service/alembic/versions/6079f2fae734_changing_module_to_not_nullable.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 312 | 2017-09-08T15:42:13.000Z | 2022-03-23T18:21:40.000Z | rdr_service/alembic/versions/6079f2fae734_changing_module_to_not_nullable.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 19 | 2017-09-15T13:58:00.000Z | 2022-02-07T18:33:20.000Z | """changing module to not nullable
Revision ID: 6079f2fae734
Revises: 6de7e8a83d66, 1db87855f77c
Create Date: 2021-06-10 17:32:53.546706
"""
from alembic import op
import sqlalchemy as sa
import rdr_service.model.utils
from sqlalchemy.dialects import mysql
from rdr_service.participant_enums import PhysicalMeasuremen... | 32.876923 | 125 | 0.755732 | """changing module to not nullable
Revision ID: 6079f2fae734
Revises: 6de7e8a83d66, 1db87855f77c
Create Date: 2021-06-10 17:32:53.546706
"""
from alembic import op
import sqlalchemy as sa
import rdr_service.model.utils
from sqlalchemy.dialects import mysql
from rdr_service.participant_enums import PhysicalMeasuremen... | 815 | 0 | 138 |
a37584b6e0616669d74728658e2f12ceea936f38 | 6,366 | py | Python | scrapydm/scrapydm/utils.py | gitduk/web_craw | 0d3d5c3de91bb1a1c83845464b7279069d5a66f5 | [
"MIT"
] | null | null | null | scrapydm/scrapydm/utils.py | gitduk/web_craw | 0d3d5c3de91bb1a1c83845464b7279069d5a66f5 | [
"MIT"
] | null | null | null | scrapydm/scrapydm/utils.py | gitduk/web_craw | 0d3d5c3de91bb1a1c83845464b7279069d5a66f5 | [
"MIT"
] | 2 | 2021-04-30T06:14:59.000Z | 2022-01-20T07:16:14.000Z | import webbrowser
from mplus.moduls.response import Selector
from mplus.utils.data import search
import re as _re
def re(response, regex, replace_entities=False, flags=_re.S):
"""
@summary: 正则匹配
注意:网页源码<a class='page-numbers'... 会被处理成<a class="page-numbers" ; 写正则时要写<a class="(.*?)"。 但不会改非html... | 28.80543 | 110 | 0.631794 | import webbrowser
from mplus.moduls.response import Selector
from mplus.utils.data import search
import re as _re
def is_html(response):
content_type = response.headers.get("Content-Type", "")
if "text/html" in content_type:
return True
else:
return False
def extract(selector):
retur... | 4,395 | 0 | 529 |
b9818ea0e35be55df7e8533d0798e10e3d2f1c68 | 4,817 | py | Python | hgext/factotum.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | hgext/factotum.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | hgext/factotum.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # factotum.py - Plan 9 factotum integration for Mercurial
#
# Copyright (C) 2012 Steven Stallion <sstallion@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the L... | 32.328859 | 78 | 0.662861 | # factotum.py - Plan 9 factotum integration for Mercurial
#
# Copyright (C) 2012 Steven Stallion <sstallion@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the L... | 2,299 | 0 | 114 |
3c05781fb25fe2d4a277c3a5c42b9a0339539847 | 3,714 | py | Python | src/marker_pose_estimation_videos.py | takuya-ki/aruco-camera-calibration | b8974320ef2bc940793609c358dbd4edbfc10fe5 | [
"MIT"
] | 1 | 2021-10-31T04:52:46.000Z | 2021-10-31T04:52:46.000Z | src/marker_pose_estimation_videos.py | takuya-ki/aruco-camera-calibration | b8974320ef2bc940793609c358dbd4edbfc10fe5 | [
"MIT"
] | null | null | null | src/marker_pose_estimation_videos.py | takuya-ki/aruco-camera-calibration | b8974320ef2bc940793609c358dbd4edbfc10fe5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import cv2
import pickle
import os.path as osp
import utils
aruco = cv2.aruco
def pose_esitmation(
frame,
dictionary,
marker_length,
camera_matrix,
dist_coeffs):
"""Estimates poses of detected markers in the frame."""
gray = cv2.cvtC... | 29.951613 | 79 | 0.609855 | #!/usr/bin/env python3
import os
import cv2
import pickle
import os.path as osp
import utils
aruco = cv2.aruco
def pose_esitmation(
frame,
dictionary,
marker_length,
camera_matrix,
dist_coeffs):
"""Estimates poses of detected markers in the frame."""
gray = cv2.cvtC... | 0 | 0 | 0 |
24d6e6191887eace6131548ab2cc8344ae05a359 | 848 | py | Python | mfi_customization/mfi/patch/migrate_patch.py | anuradha-88/mfi_customization | eb19ed43d0178b461f1d9914d2f7b6b55c9d030c | [
"MIT"
] | null | null | null | mfi_customization/mfi/patch/migrate_patch.py | anuradha-88/mfi_customization | eb19ed43d0178b461f1d9914d2f7b6b55c9d030c | [
"MIT"
] | null | null | null | mfi_customization/mfi/patch/migrate_patch.py | anuradha-88/mfi_customization | eb19ed43d0178b461f1d9914d2f7b6b55c9d030c | [
"MIT"
] | null | null | null | import frappe
import os
import json
import sys
# bench execute mfi_customization.mfi.patch.migrate_patch.get_custom_role_permission
# bench execute mfi_customization.mfi.patch.migrate_patch.set_custom_role_permission
| 35.333333 | 104 | 0.65684 | import frappe
import os
import json
import sys
# bench execute mfi_customization.mfi.patch.migrate_patch.get_custom_role_permission
def get_custom_role_permission(site=None):
if sys.argv[2]=='--site':
os.system("bench --site {0} export-fixtures".format(sys.argv[3]))
else:
os.system("bench ex... | 579 | 0 | 44 |
b71910efe5888311570a4b40f1ae9de9d971539e | 10,101 | py | Python | data_processing/download_repo_text.py | ndrpnt/gpt-code-clippy | 72e0c2798c7ecc7dd1633576d402a9ded1b8b24d | [
"Apache-2.0"
] | 435 | 2021-08-09T17:36:29.000Z | 2022-03-31T20:12:32.000Z | data_processing/download_repo_text.py | ndrpnt/gpt-code-clippy | 72e0c2798c7ecc7dd1633576d402a9ded1b8b24d | [
"Apache-2.0"
] | 23 | 2021-08-09T17:24:28.000Z | 2022-03-05T06:15:31.000Z | data_processing/download_repo_text.py | Daasin/codepy-lot | 6341c2f2e44ab25ec4a0ef1490c4ee8be1e80d72 | [
"Apache-2.0"
] | 46 | 2021-08-11T11:38:35.000Z | 2022-03-26T08:18:59.000Z | # Copyright maintained by EleutherAI. Originally from https://github.com/EleutherAI/github-downloader
import chardet
import magic
import lm_dataformat as lmd
import os
import random
import sys
import traceback
import shutil
import csv
import json
from multiprocessing import cpu_count, Pool
from tqdm import tqdm
import... | 29.535088 | 119 | 0.570043 | # Copyright maintained by EleutherAI. Originally from https://github.com/EleutherAI/github-downloader
import chardet
import magic
import lm_dataformat as lmd
import os
import random
import sys
import traceback
import shutil
import csv
import json
from multiprocessing import cpu_count, Pool
from tqdm import tqdm
import... | 6,545 | 18 | 276 |
5ed077b7fe7d9508bd124319c204f958af93f5bf | 824 | py | Python | automatic_navigation.py | Ulzahk/Practica-Selenium-Python | f2d0f215afb8ebba019544b3eb60cf2f7f23ddbf | [
"MIT"
] | null | null | null | automatic_navigation.py | Ulzahk/Practica-Selenium-Python | f2d0f215afb8ebba019544b3eb60cf2f7f23ddbf | [
"MIT"
] | null | null | null | automatic_navigation.py | Ulzahk/Practica-Selenium-Python | f2d0f215afb8ebba019544b3eb60cf2f7f23ddbf | [
"MIT"
] | null | null | null | import unittest
from selenium import webdriver
from time import sleep
if __name__ == '__main__':
unittest.main(verbosity = 2) | 22.27027 | 79 | 0.631068 | import unittest
from selenium import webdriver
from time import sleep
class NavigationTest(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome(executable_path = r'./chromedriver.exe')
driver = self.driver
driver.implicitly_wait(30)
driver.maximize_window()
d... | 567 | 19 | 103 |
8a13148b6786d6dc15034578e09513803ef7a95b | 3,008 | py | Python | tests/test_pdal.py | readthedocs-assistant/adaptivefiltering | 4c2a2a116869f7a931befb9aa9a5b658aed3e497 | [
"MIT"
] | 2 | 2022-02-11T08:31:11.000Z | 2022-03-21T10:19:16.000Z | tests/test_pdal.py | readthedocs-assistant/adaptivefiltering | 4c2a2a116869f7a931befb9aa9a5b658aed3e497 | [
"MIT"
] | 187 | 2021-06-21T19:46:15.000Z | 2022-03-21T12:14:47.000Z | tests/test_pdal.py | readthedocs-assistant/adaptivefiltering | 4c2a2a116869f7a931befb9aa9a5b658aed3e497 | [
"MIT"
] | 3 | 2022-01-19T20:06:57.000Z | 2022-03-21T09:27:17.000Z | from adaptivefiltering.pdal import *
from adaptivefiltering.paths import get_temporary_filename
from . import dataset, minimal_dataset
import jsonschema
import os
import pyrsistent
import pytest
_pdal_filter_list = [
"filters.csf",
"filters.elm",
"filters.outlier",
"filters.pmf",
"filters.skewne... | 29.782178 | 71 | 0.729721 | from adaptivefiltering.pdal import *
from adaptivefiltering.paths import get_temporary_filename
from . import dataset, minimal_dataset
import jsonschema
import os
import pyrsistent
import pytest
_pdal_filter_list = [
"filters.csf",
"filters.elm",
"filters.outlier",
"filters.pmf",
"filters.skewne... | 2,416 | 0 | 113 |
999fce8f0bea1b1525bff898be3be301c22e4333 | 3,179 | py | Python | appCore/apps/replica/contrib/micro/migrations/0001_initial.py | jadedgamer/alifewellplayed.com | b7b3dee8d3b9526c7cfe77078570a29394ef7e76 | [
"MIT"
] | 4 | 2017-04-22T11:03:01.000Z | 2018-01-16T22:28:15.000Z | appCore/apps/replica/contrib/micro/migrations/0001_initial.py | alifewellplayed/alifewellplayed.com | b7b3dee8d3b9526c7cfe77078570a29394ef7e76 | [
"MIT"
] | 10 | 2017-04-06T19:54:42.000Z | 2017-11-07T06:53:10.000Z | appCore/apps/replica/contrib/micro/migrations/0001_initial.py | alifewellplayed/alifewellplayed.com | b7b3dee8d3b9526c7cfe77078570a29394ef7e76 | [
"MIT"
] | 1 | 2017-12-14T12:49:40.000Z | 2017-12-14T12:49:40.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-07 14:31
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
| 42.959459 | 144 | 0.584146 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-07 14:31
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
... | 0 | 2,922 | 23 |
b93585d9fb0440c4823519a42db042ee5afd40b6 | 4,799 | py | Python | badger/admin.py | Mozilla-GitHub-Standards/32f019951cddad4b74a875d0f0cc472e0a12b7e2230cfb89db5a8cf6398a735b | b22fd24974b443e064db04eae67ef8627c1938a8 | [
"BSD-3-Clause"
] | 37 | 2015-04-01T00:08:27.000Z | 2021-04-08T06:51:39.000Z | badger/admin.py | Mozilla-GitHub-Standards/32f019951cddad4b74a875d0f0cc472e0a12b7e2230cfb89db5a8cf6398a735b | b22fd24974b443e064db04eae67ef8627c1938a8 | [
"BSD-3-Clause"
] | 10 | 2015-02-27T22:36:16.000Z | 2019-03-28T12:33:42.000Z | badger/admin.py | Mozilla-GitHub-Standards/32f019951cddad4b74a875d0f0cc472e0a12b7e2230cfb89db5a8cf6398a735b | b22fd24974b443e064db04eae67ef8627c1938a8 | [
"BSD-3-Clause"
] | 20 | 2015-02-11T11:20:12.000Z | 2021-04-30T21:27:19.000Z | from urlparse import urljoin
from django.conf import settings
from django.contrib import admin
from django import forms
from django.db import models
try:
from funfactory.urlresolvers import reverse
except ImportError:
from django.core.urlresolvers import reverse
from .models import (Badge, Award, Nomination... | 32.425676 | 87 | 0.653469 | from urlparse import urljoin
from django.conf import settings
from django.contrib import admin
from django import forms
from django.db import models
try:
from funfactory.urlresolvers import reverse
except ImportError:
from django.core.urlresolvers import reverse
from .models import (Badge, Award, Nomination... | 1,318 | 1,946 | 299 |
82552fed6113a33da33a8bf76c9ed5b49d771949 | 865 | py | Python | tests/config_test.py | sgissinger/grappa | 51157a828d5cfdc731cada9b16255eaaf1cabbe6 | [
"MIT"
] | 137 | 2017-03-28T10:19:07.000Z | 2022-01-30T19:21:32.000Z | tests/config_test.py | sgissinger/grappa | 51157a828d5cfdc731cada9b16255eaaf1cabbe6 | [
"MIT"
] | 47 | 2017-03-19T23:08:48.000Z | 2021-01-25T15:18:10.000Z | tests/config_test.py | grappa-project/grappa | f1861e1572e68f031977e86a5d9eba1957bd164e | [
"MIT"
] | 17 | 2017-03-28T10:39:13.000Z | 2021-07-23T20:50:15.000Z | import pytest
import grappa
from grappa.config import Config
| 26.212121 | 75 | 0.675145 | import pytest
import grappa
from grappa.config import Config
def test_config(should):
grappa | should.have.property('config') > should.be.instance.of(Config)
# Create new config
conf = Config()
# Clone
assert conf.__dict__['opts'] is not grappa.config.__dict__['opts']
# Setter/getter magic ... | 780 | 0 | 23 |
d7cf100798aec83db3fde67ef48c14dd605cf6a7 | 3,466 | py | Python | src/backend/partaj/core/migrations/0016_add_referral_activity.py | MTES-MCT/partaj | 0025c17a96d9212430d18ec36f6a2474c4609738 | [
"MIT"
] | 2 | 2020-10-15T11:28:26.000Z | 2021-06-25T15:24:33.000Z | src/backend/partaj/core/migrations/0016_add_referral_activity.py | MTES-MCT/partaj | 0025c17a96d9212430d18ec36f6a2474c4609738 | [
"MIT"
] | 7 | 2020-10-01T14:49:51.000Z | 2022-01-24T09:44:10.000Z | src/backend/partaj/core/migrations/0016_add_referral_activity.py | MTES-MCT/partaj | 0025c17a96d9212430d18ec36f6a2474c4609738 | [
"MIT"
] | 3 | 2020-03-18T15:53:26.000Z | 2021-09-16T14:39:27.000Z | # Generated by Django 3.0.5 on 2020-05-20 13:05
import uuid
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
| 35.731959 | 88 | 0.401327 | # Generated by Django 3.0.5 on 2020-05-20 13:05
import uuid
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("contenttypes", "0002_remove_content_type_name"),
migrations.swappable_... | 0 | 3,273 | 23 |
96ec1dae57eb5324ac21642918daf7767612348f | 407 | py | Python | CursoPython/Python_Mundo_1/Exercicio004.py | XiaoNaihe/Python | 5ba12ae8beff325b069d13210d34116373de2f5d | [
"MIT"
] | null | null | null | CursoPython/Python_Mundo_1/Exercicio004.py | XiaoNaihe/Python | 5ba12ae8beff325b069d13210d34116373de2f5d | [
"MIT"
] | null | null | null | CursoPython/Python_Mundo_1/Exercicio004.py | XiaoNaihe/Python | 5ba12ae8beff325b069d13210d34116373de2f5d | [
"MIT"
] | null | null | null | a = input('Digite Algo: ')
print(f'O tipo primitivo desse valor é: ', type(a))
print(f'Só tem espaços? {a.isspace()} ')
print(f'Isso é um numero? {a.isnumeric()} ')
print(f'Isso é Alfabético? {a.isalpha()} ')
print(f'Isso é Alfanumerico? {a.isnumeric()} ')
print(f'Está em letras maiúsculas? {a.isupper()} ')
print(f'E... | 40.7 | 51 | 0.665848 | a = input('Digite Algo: ')
print(f'O tipo primitivo desse valor é: ', type(a))
print(f'Só tem espaços? {a.isspace()} ')
print(f'Isso é um numero? {a.isnumeric()} ')
print(f'Isso é Alfabético? {a.isalpha()} ')
print(f'Isso é Alfanumerico? {a.isnumeric()} ')
print(f'Está em letras maiúsculas? {a.isupper()} ')
print(f'E... | 0 | 0 | 0 |
93f23a3303fb19dfac6551a5840e78b56cc9c590 | 2,969 | py | Python | prepare_dataset.py | talolard/BibSample | 4bdffcce720a60f5b2e2786b73654710541cec9a | [
"MIT"
] | null | null | null | prepare_dataset.py | talolard/BibSample | 4bdffcce720a60f5b2e2786b73654710541cec9a | [
"MIT"
] | null | null | null | prepare_dataset.py | talolard/BibSample | 4bdffcce720a60f5b2e2786b73654710541cec9a | [
"MIT"
] | null | null | null | import tensorflow as tf
from preppy import BibPreppy
def expand(x):
'''
Hack. Because padded_batch doesn't play nice with scalars, so we expand the scalar to a vector of length 1
:param x:
:return:
'''
x['length'] = tf.expand_dims(tf.convert_to_tensor(x['length']), 0)
x['book_id'] = tf.ex... | 41.816901 | 114 | 0.701246 | import tensorflow as tf
from preppy import BibPreppy
def expand(x):
'''
Hack. Because padded_batch doesn't play nice with scalars, so we expand the scalar to a vector of length 1
:param x:
:return:
'''
x['length'] = tf.expand_dims(tf.convert_to_tensor(x['length']), 0)
x['book_id'] = tf.ex... | 862 | 0 | 23 |
b2e68e108fe7379d21a60d68ba31ebb818166f38 | 521 | py | Python | cerami/datatype/translator/boolean_translator.py | gummybuns/dorm | e97c0baa42c4bdfb10bbe3b4b859873e3d50aa3a | [
"MIT"
] | null | null | null | cerami/datatype/translator/boolean_translator.py | gummybuns/dorm | e97c0baa42c4bdfb10bbe3b4b859873e3d50aa3a | [
"MIT"
] | null | null | null | cerami/datatype/translator/boolean_translator.py | gummybuns/dorm | e97c0baa42c4bdfb10bbe3b4b859873e3d50aa3a | [
"MIT"
] | null | null | null | from .base_datatype_translator import BaseDatatypeTranslator
class BooleanTranslator(BaseDatatypeTranslator):
"""A Translator class for converting fields into DynamoDB booleans
For example::
translator = BooleanTranslator(Boolean())
translator.to_dynamodb(True)
{'BOOL': True}
... | 24.809524 | 70 | 0.677543 | from .base_datatype_translator import BaseDatatypeTranslator
class BooleanTranslator(BaseDatatypeTranslator):
"""A Translator class for converting fields into DynamoDB booleans
For example::
translator = BooleanTranslator(Boolean())
translator.to_dynamodb(True)
{'BOOL': True}
... | 84 | 0 | 54 |
749285555b2f486ea7f06574bed1d54243e83879 | 2,636 | py | Python | two_lane_traffic.py | nimr0d/traffic-flow | 642cfb72c67c882201b63e383983e7def141b59c | [
"MIT"
] | null | null | null | two_lane_traffic.py | nimr0d/traffic-flow | 642cfb72c67c882201b63e383983e7def141b59c | [
"MIT"
] | null | null | null | two_lane_traffic.py | nimr0d/traffic-flow | 642cfb72c67c882201b63e383983e7def141b59c | [
"MIT"
] | null | null | null | import numpy as np
import random
| 33.367089 | 88 | 0.517451 | import numpy as np
import random
class Car:
def __init__(self, position = 0, lane = 0, velocity = 0, aggressiveness = 0, id = 0):
self.p = position
self.l = lane
self.v = velocity
self.a = aggressiveness
self.id = id
class Traffic:
def __init__(self, n = 100, max_v = 5, density = .1, prob = ... | 2,405 | -18 | 216 |
fbf7beb34f3b61e70f16d18032efeb4007e7fb0d | 4,248 | py | Python | speech-to-text/augmentation.py | huseinzol05/Bahasa-NLP-Tensorflow | 4e6427230e36c2d79ec951c7f2c3501bf75f9a8a | [
"MIT"
] | 31 | 2019-05-02T20:47:35.000Z | 2021-11-01T06:05:55.000Z | speech-to-text/augmentation.py | mesolitica/Bahasa-NLP-Tensorflow | 4e6427230e36c2d79ec951c7f2c3501bf75f9a8a | [
"MIT"
] | 2 | 2019-05-30T22:10:40.000Z | 2020-02-17T08:07:20.000Z | speech-to-text/augmentation.py | mesolitica/Bahasa-NLP-Tensorflow | 4e6427230e36c2d79ec951c7f2c3501bf75f9a8a | [
"MIT"
] | 15 | 2019-05-02T10:30:34.000Z | 2022-03-04T08:21:14.000Z | import numpy as np
import librosa
import os
import scipy
import json
with open('train-test.json') as fopen:
wavs = json.load(fopen)['train']
if not os.path.exists('augment'):
os.makedirs('augment')
for no, wav in enumerate(wavs):
try:
root, ext = os.path.splitext(wav)
if (no + 1) %... | 27.947368 | 76 | 0.552966 | import numpy as np
import librosa
import os
import scipy
import json
def change_pitch_speech(samples):
y_pitch_speed = samples.copy()
length_change = np.random.uniform(low = 0.8, high = 1)
speed_fac = 1.0 / length_change
tmp = np.interp(
np.arange(0, len(y_pitch_speed), speed_fac),
np.... | 2,329 | 0 | 138 |
5b91fcd37d97a25c8fdb4dbd92cd1de3a55bad48 | 2,098 | py | Python | src/datafactory/azext_datafactory/manual/custom.py | sanmishra18/azure-cli-extensions | 05499b7931a1fe4cd4536a6b83fa4f8f13663996 | [
"MIT"
] | 1 | 2021-04-22T09:20:58.000Z | 2021-04-22T09:20:58.000Z | src/datafactory/azext_datafactory/manual/custom.py | sanmishra18/azure-cli-extensions | 05499b7931a1fe4cd4536a6b83fa4f8f13663996 | [
"MIT"
] | null | null | null | src/datafactory/azext_datafactory/manual/custom.py | sanmishra18/azure-cli-extensions | 05499b7931a1fe4cd4536a6b83fa4f8f13663996 | [
"MIT"
] | 1 | 2020-11-09T17:17:42.000Z | 2020-11-09T17:17:42.000Z | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incor... | 51.170732 | 116 | 0.551478 | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incor... | 1,583 | 0 | 23 |
074ec71ad27a728fcb92493cee08ad244a062f16 | 2,471 | py | Python | curve_fit_peak_finder_wf.py | fwk446/pyhon-course | 09d68aa7a97ed09783feed11950d05a8a8c7c01a | [
"Apache-2.0"
] | null | null | null | curve_fit_peak_finder_wf.py | fwk446/pyhon-course | 09d68aa7a97ed09783feed11950d05a8a8c7c01a | [
"Apache-2.0"
] | null | null | null | curve_fit_peak_finder_wf.py | fwk446/pyhon-course | 09d68aa7a97ed09783feed11950d05a8a8c7c01a | [
"Apache-2.0"
] | null | null | null | # import necessary libraries
import numpy as np
import pandas as pd
from scipy.signal import find_peaks
import matplotlib.pyplot as plt
import csv
# global variable definition
n=100 # number of sample points
deg1 = 30 # polynomial order for fit
xs=np.linspace(0,1,n) # spacing for data
x= np.arange(0, n, 1)
... | 27.153846 | 124 | 0.673007 | # import necessary libraries
import numpy as np
import pandas as pd
from scipy.signal import find_peaks
import matplotlib.pyplot as plt
import csv
# global variable definition
n=100 # number of sample points
deg1 = 30 # polynomial order for fit
xs=np.linspace(0,1,n) # spacing for data
x= np.arange(0, n, 1)
... | 0 | 0 | 0 |
b99efa096e6db920ad2bf404249b919bf8559e20 | 10,617 | py | Python | update_data/temp_download.py | louieh/Course-Search | eeaedaf9fb9895f4855fc86b1700f27c8223339b | [
"MIT"
] | 3 | 2018-12-14T18:30:52.000Z | 2021-06-13T06:51:30.000Z | update_data/temp_download.py | louieh/Course-Search | eeaedaf9fb9895f4855fc86b1700f27c8223339b | [
"MIT"
] | 2 | 2021-03-31T19:07:33.000Z | 2021-03-31T19:22:48.000Z | update_data/temp_download.py | louieh/Course-Search | eeaedaf9fb9895f4855fc86b1700f27c8223339b | [
"MIT"
] | 1 | 2019-02-15T06:11:34.000Z | 2019-02-15T06:11:34.000Z | import json
import requests
from lxml import html
import redis
from pymongo import MongoClient
import datetime
# 1.直接下载coursebook入库
# 2.直接下载coursebook reportmonkey入库
# 3.下载coursebook获取reportmonkey key然后下载coursebook reportmonkey入库
# TODO 三个解析器
# TODO 两个下载器
if __name__ == "__main__":
coursebook_spider = CouseBo... | 47.397321 | 149 | 0.554959 | import json
import requests
from lxml import html
import redis
from pymongo import MongoClient
import datetime
# 1.直接下载coursebook入库
# 2.直接下载coursebook reportmonkey入库
# 3.下载coursebook获取reportmonkey key然后下载coursebook reportmonkey入库
# TODO 三个解析器
# TODO 两个下载器
class CouseBookSpider(object):
def __init__(self):
... | 9,984 | 9 | 265 |
96b2f7271816c3dd408d741193f53a71ba9c33b5 | 2,493 | py | Python | skyfield/api.py | xmichaelx/python-skyfield | a30a3e53a0973336ae1ac19db7d09ba0d5cb0b73 | [
"MIT"
] | null | null | null | skyfield/api.py | xmichaelx/python-skyfield | a30a3e53a0973336ae1ac19db7d09ba0d5cb0b73 | [
"MIT"
] | null | null | null | skyfield/api.py | xmichaelx/python-skyfield | a30a3e53a0973336ae1ac19db7d09ba0d5cb0b73 | [
"MIT"
] | null | null | null | """Top-level objects and functions offered by the Skyfield library.
Importing this library is not always the fastest way to use a Skyfield
feature, since importing this module involves importing almost the
entirety of Skyfield and its dependencies, but is the most convenient
way for most users to use Skyfield's main f... | 37.208955 | 85 | 0.727236 | """Top-level objects and functions offered by the Skyfield library.
Importing this library is not always the fastest way to use a Skyfield
feature, since importing this module involves importing almost the
entirety of Skyfield and its dependencies, but is the most convenient
way for most users to use Skyfield's main f... | 974 | 4 | 72 |
cb90ad239d840f8a7013fa2ed15a6dfd9e99d018 | 615 | py | Python | gui_client/ui/error_page.py | Mozzo1000/virgo | 30f0b8606d5ad5d651f7d628d231e0bb99928626 | [
"Apache-2.0"
] | null | null | null | gui_client/ui/error_page.py | Mozzo1000/virgo | 30f0b8606d5ad5d651f7d628d231e0bb99928626 | [
"Apache-2.0"
] | null | null | null | gui_client/ui/error_page.py | Mozzo1000/virgo | 30f0b8606d5ad5d651f7d628d231e0bb99928626 | [
"Apache-2.0"
] | null | null | null | general_error = """
<html>
<head>
<style>
body {
height: 100%;
width: 100%;
background-color: #9E9E9E;
}
.box {
border: 1px solid green ;
background... | 25.625 | 47 | 0.326829 | general_error = """
<html>
<head>
<style>
body {
height: 100%;
width: 100%;
background-color: #9E9E9E;
}
.box {
border: 1px solid green ;
background... | 0 | 0 | 0 |
8d0fb7a19087c5bcf20447d2a08fd40d0de7a91a | 2,251 | py | Python | build-support/bin/check_pants_pex_abi.py | CMLivingston/pants | 4395289966d6ec4a9525367c82629c35fb461b2a | [
"Apache-2.0"
] | null | null | null | build-support/bin/check_pants_pex_abi.py | CMLivingston/pants | 4395289966d6ec4a9525367c82629c35fb461b2a | [
"Apache-2.0"
] | null | null | null | build-support/bin/check_pants_pex_abi.py | CMLivingston/pants | 4395289966d6ec4a9525367c82629c35fb461b2a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2.7
# coding=utf-8
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
# Check that the ./pants.pex was built using the passed abi specification.
from __future__ import absolute_import, division, print_function, unicod... | 33.102941 | 96 | 0.698801 | #!/usr/bin/env python2.7
# coding=utf-8
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
# Check that the ./pants.pex was built using the passed abi specification.
from __future__ import absolute_import, division, print_function, unicod... | 1,379 | 0 | 92 |
46db80d7698bcc8c3308484dfed54981799d04bf | 1,291 | py | Python | solvers/tests/test_ea_solver.py | omyllymaki/shifting-peaks | 0dd67662daac29ce1c2db257553c3355202a46f1 | [
"MIT"
] | null | null | null | solvers/tests/test_ea_solver.py | omyllymaki/shifting-peaks | 0dd67662daac29ce1c2db257553c3355202a46f1 | [
"MIT"
] | null | null | null | solvers/tests/test_ea_solver.py | omyllymaki/shifting-peaks | 0dd67662daac29ce1c2db257553c3355202a46f1 | [
"MIT"
] | null | null | null | from solvers.ea_solver import EASolver
from solvers.math import interpolate_signal, ls_fit
from solvers.tests.base_test_case import BaseTestCase
from solvers.tests.correction_models import linear_correction
| 39.121212 | 83 | 0.659954 | from solvers.ea_solver import EASolver
from solvers.math import interpolate_signal, ls_fit
from solvers.tests.base_test_case import BaseTestCase
from solvers.tests.correction_models import linear_correction
class TestEASolver(BaseTestCase):
def setUp(self):
super().setUp()
self.solver = EASolver(x... | 914 | 12 | 157 |
41f28eeb49413b95d4098209abfe6303e548568d | 1,784 | py | Python | shop/tests.py | PavelBelka/tp_lab_2-django | a58eddf03994f62547627205c792c87575749b79 | [
"MIT"
] | null | null | null | shop/tests.py | PavelBelka/tp_lab_2-django | a58eddf03994f62547627205c792c87575749b79 | [
"MIT"
] | null | null | null | shop/tests.py | PavelBelka/tp_lab_2-django | a58eddf03994f62547627205c792c87575749b79 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.contrib.auth.models import User
from .models import Purchase
from django.test import TestCase
from django.urls import reverse
| 34.980392 | 86 | 0.66648 | from django.contrib.auth import get_user_model
from django.contrib.auth.models import User
from .models import Purchase
from django.test import TestCase
from django.urls import reverse
class IndexViewTests(TestCase):
def test_no_products(self):
response = self.client.get(reverse('index'))
self.ass... | 1,266 | 34 | 297 |
bc008f3024eb12032e2d5cb7e1905325ff319524 | 7,107 | py | Python | copyright_updater/find.py | swasun/copyright-updater | 750ced32ee9738e4d65189bc0e917e0581a59668 | [
"MIT"
] | null | null | null | copyright_updater/find.py | swasun/copyright-updater | 750ced32ee9738e4d65189bc0e917e0581a59668 | [
"MIT"
] | null | null | null | copyright_updater/find.py | swasun/copyright-updater | 750ced32ee9738e4d65189bc0e917e0581a59668 | [
"MIT"
] | null | null | null | #####################################################################################
# MIT License #
# #
# Copyright (C) 2018 Charly Lamothe ... | 50.404255 | 123 | 0.596032 | #####################################################################################
# MIT License #
# #
# Copyright (C) 2018 Charly Lamothe ... | 4,771 | 0 | 46 |
4b3a7ad920c98694ed0aea0af1508c987caccd19 | 2,032 | py | Python | popong_models/bill.py | teampopong/popong-models | 9919a323204592b49c95ee46632e1c2df1cf35fa | [
"BSD-3-Clause"
] | 1 | 2016-02-28T13:58:14.000Z | 2016-02-28T13:58:14.000Z | popong_models/bill.py | teampopong/popong-models | 9919a323204592b49c95ee46632e1c2df1cf35fa | [
"BSD-3-Clause"
] | null | null | null | popong_models/bill.py | teampopong/popong-models | 9919a323204592b49c95ee46632e1c2df1cf35fa | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from sqlalchemy import Boolean, Column, Date, func, Integer, select, String, Text, Unicode
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.orm import column_property, relationship
from .api_model import ApiModel
from .base import Base
from .bill_keyword import bill_keyword
fro... | 33.311475 | 90 | 0.668307 | # -*- coding: utf-8 -*-
from sqlalchemy import Boolean, Column, Date, func, Integer, select, String, Text, Unicode
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.orm import column_property, relationship
from .api_model import ApiModel
from .base import Base
from .bill_keyword import bill_keyword
fro... | 125 | 984 | 23 |
1ef773ad49612de7de1bea49df0cf9955363f50e | 664 | py | Python | student_fee_payments/urls.py | Cent-Luc/University_Portal | 82bf40a1c0d98111ffe8a184d16b543a3feec072 | [
"MIT"
] | null | null | null | student_fee_payments/urls.py | Cent-Luc/University_Portal | 82bf40a1c0d98111ffe8a184d16b543a3feec072 | [
"MIT"
] | 1 | 2021-03-18T22:00:32.000Z | 2021-03-18T22:00:32.000Z | student_fee_payments/urls.py | c3n7/university-portal | 82bf40a1c0d98111ffe8a184d16b543a3feec072 | [
"MIT"
] | 3 | 2019-11-14T08:50:15.000Z | 2019-11-15T15:36:45.000Z | from django.urls import path
from .views import (
StudentFeePaymentCreateView,
StudentFeePaymentListView,
StudentFeePaymentDetailView,
StudentFeePaymentUpdateView,
)
urlpatterns = [
path(
'add/',
StudentFeePaymentCreateView.as_view(),
name='StudentFeePayment_add'),
path... | 24.592593 | 48 | 0.644578 | from django.urls import path
from .views import (
StudentFeePaymentCreateView,
StudentFeePaymentListView,
StudentFeePaymentDetailView,
StudentFeePaymentUpdateView,
)
urlpatterns = [
path(
'add/',
StudentFeePaymentCreateView.as_view(),
name='StudentFeePayment_add'),
path... | 0 | 0 | 0 |
c728add72ed6a3c7e7a22d0dd5c2d28795629874 | 70,636 | py | Python | paddlenlp/transformers/albert/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/albert/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/albert/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
# Copyright 2018 Google AI, Google Brain and the HuggingFace Inc. team.
#
# 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
#
# ... | 38.305857 | 140 | 0.597641 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
# Copyright 2018 Google AI, Google Brain and the HuggingFace Inc. team.
#
# 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
#
# ... | 19,139 | 43 | 1,120 |
6d0decd079fd831d9b0aff23781e67f9fdb25d77 | 3,805 | py | Python | am_driver_safe/src/pose_RK4_Enc.py | boffomarco/hrp | 7017d358b8b53c289d0859f7dc61ca0d134843ed | [
"MIT"
] | null | null | null | am_driver_safe/src/pose_RK4_Enc.py | boffomarco/hrp | 7017d358b8b53c289d0859f7dc61ca0d134843ed | [
"MIT"
] | null | null | null | am_driver_safe/src/pose_RK4_Enc.py | boffomarco/hrp | 7017d358b8b53c289d0859f7dc61ca0d134843ed | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import math
from math import sin, cos, pi
import rospy
import tf
from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3
from am_driver.msg import WheelEncoder
if __name__ == '__main__':
try:
poseEncCheckRK4 = PoseEncCheckRK4()
rospy.spin()
#od... | 31.188525 | 108 | 0.602365 | #!/usr/bin/env python3
import math
from math import sin, cos, pi
import rospy
import tf
from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3
from am_driver.msg import WheelEncoder
class PoseEncCheckRK4():
def __init__(self):
print("Initialising PoseEncCheckRK4")
rospy.init_nod... | 3,337 | 3 | 77 |
7fe69dace35df00eeb68f20bfddab05632d8f9f5 | 6,525 | py | Python | cvnets/models/video_classification/__init__.py | apple/ml-cvnets | 84d992f413e52c0468f86d23196efd9dad885e6f | [
"AML"
] | 209 | 2021-10-30T08:32:10.000Z | 2022-03-31T16:18:03.000Z | cvnets/models/video_classification/__init__.py | apple/ml-cvnets | 84d992f413e52c0468f86d23196efd9dad885e6f | [
"AML"
] | 12 | 2021-12-04T10:47:11.000Z | 2022-03-31T15:39:40.000Z | cvnets/models/video_classification/__init__.py | apple/ml-cvnets | 84d992f413e52c0468f86d23196efd9dad885e6f | [
"AML"
] | 50 | 2021-11-01T08:15:02.000Z | 2022-03-29T08:17:34.000Z | #
# For licensing see accompanying LICENSE file.
# Copyright (C) 2022 Apple Inc. All Rights Reserved.
#
import os
import importlib
import argparse
from utils import logger
from utils.common_utils import check_frozen_norm_layer
from utils.ddp_utils import is_master, is_start_rank_node
from utils.download_utils import ... | 32.625 | 112 | 0.64613 | #
# For licensing see accompanying LICENSE file.
# Copyright (C) 2022 Apple Inc. All Rights Reserved.
#
import os
import importlib
import argparse
from utils import logger
from utils.common_utils import check_frozen_norm_layer
from utils.ddp_utils import is_master, is_start_rank_node
from utils.download_utils import ... | 5,438 | 0 | 92 |
9d26ac9d80cb1da7816cd03b7d011e0e56f963db | 2,684 | py | Python | image_processing_course/sw_s01e11.py | PUTvision/ImageProcessingCourse | 9ef6cf6f65eec3703c3a70e1bef4d8a39669e540 | [
"MIT"
] | 1 | 2019-02-12T18:13:20.000Z | 2019-02-12T18:13:20.000Z | image_processing_course/sw_s01e11.py | PUTvision/ImageProcessingCourse | 9ef6cf6f65eec3703c3a70e1bef4d8a39669e540 | [
"MIT"
] | null | null | null | image_processing_course/sw_s01e11.py | PUTvision/ImageProcessingCourse | 9ef6cf6f65eec3703c3a70e1bef4d8a39669e540 | [
"MIT"
] | 2 | 2020-06-07T11:01:49.000Z | 2021-01-07T08:38:35.000Z | import cv2
import numpy as np
if __name__ == '__main__':
ex_1()
ex_2()
ex_3()
| 32.731707 | 99 | 0.688152 | import cv2
import numpy as np
def ex_1():
img_left = cv2.imread('_data/sw_s01e11/Rocks1/view1.png', cv2.IMREAD_COLOR)
img_right = cv2.imread('_data/sw_s01e11/Rocks1/view5.png', cv2.IMREAD_COLOR)
cv2.imshow('img_right', img_right)
cv2.imshow('img_left', img_left)
cv2.waitKey(0)
b_left, g_left... | 2,520 | 0 | 69 |
00c20d2a2019548224b0ea362815928c7f4e7bc3 | 1,084 | py | Python | graphgl_api.py | newtoncy/asyncio-graphql-demo | 9100cf3bf582e98ed0acd8ca4669182d3687cfe5 | [
"MIT"
] | null | null | null | graphgl_api.py | newtoncy/asyncio-graphql-demo | 9100cf3bf582e98ed0acd8ca4669182d3687cfe5 | [
"MIT"
] | null | null | null | graphgl_api.py | newtoncy/asyncio-graphql-demo | 9100cf3bf582e98ed0acd8ca4669182d3687cfe5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Author : 王超逸
@File : graphgl_api.py
@Time : 2021/2/25 14:15
@Desc : graphgl风格的api
"""
from model import *
from graphene_model_base import BaseCURD, GraphQLViewSet, GrapheneModelObject
from graphene import Int, String, Field, List, Schema
s... | 19.709091 | 77 | 0.700185 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Author : 王超逸
@File : graphgl_api.py
@Time : 2021/2/25 14:15
@Desc : graphgl风格的api
"""
from model import *
from graphene_model_base import BaseCURD, GraphQLViewSet, GrapheneModelObject
from graphene import Int, String, Field, List, Schema
class Te... | 0 | 555 | 161 |
539c104885e4a957bd5db49fd7072aaa16c55501 | 30,073 | py | Python | qiskit_metal/qlibrary/core/qroute.py | ismirlia/qiskit-metal | d788f4391a65c191b04059e8dcf25da9a35b4597 | [
"Apache-2.0"
] | 167 | 2021-03-17T20:35:17.000Z | 2022-03-31T13:25:04.000Z | qiskit_metal/qlibrary/core/qroute.py | fgnyilmaz/qiskit-metal | 04c9e5c0b5573699564244127aa58b447cdf6f66 | [
"Apache-2.0"
] | 307 | 2021-03-17T14:07:43.000Z | 2022-03-23T14:22:20.000Z | qiskit_metal/qlibrary/core/qroute.py | fgnyilmaz/qiskit-metal | 04c9e5c0b5573699564244127aa58b447cdf6f66 | [
"Apache-2.0"
] | 122 | 2021-03-17T14:21:24.000Z | 2022-03-18T10:09:38.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# 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.0.
#
# Any... | 40.584345 | 125 | 0.572706 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# 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.0.
#
# Any... | 105 | 0 | 27 |
a8bca34cf59d567e23871bc3bb83b3c63a9052e9 | 1,411 | py | Python | publications/WSJ.py | mkoo21/rss-review-scraper | 4adde8586ce55d7bb211bcfbb9bcccd1edc8b6a5 | [
"BSD-3-Clause"
] | null | null | null | publications/WSJ.py | mkoo21/rss-review-scraper | 4adde8586ce55d7bb211bcfbb9bcccd1edc8b6a5 | [
"BSD-3-Clause"
] | 1 | 2021-06-01T23:47:57.000Z | 2021-06-01T23:47:57.000Z | publications/WSJ.py | mkoo21/rss-review-scraper | 4adde8586ce55d7bb211bcfbb9bcccd1edc8b6a5 | [
"BSD-3-Clause"
] | null | null | null | from . import YESTERDAY, PST_TIMEZONE
from bs4 import BeautifulSoup
from datetime import datetime
import re
import requests
| 33.595238 | 79 | 0.588944 | from . import YESTERDAY, PST_TIMEZONE
from bs4 import BeautifulSoup
from datetime import datetime
import re
import requests
def STRINGIFY(article):
try:
return "<p><b>{}</b> - WSJ </p><a>{}</a><em>{}</em>".format(
article.find_all('div')[2].a,
article.find_all('div')[0].a['hr... | 1,215 | 0 | 69 |
962277b00e44e645139c99d7e7edebf081196ba6 | 571 | py | Python | sk_typing/multiclass.py | thomasjpfan/sk_typing | e6aacfedbce44d7748cf7c49cd2b949952f2e427 | [
"MIT"
] | 1 | 2021-02-19T20:57:36.000Z | 2021-02-19T20:57:36.000Z | sk_typing/multiclass.py | thomasjpfan/sk_typing | e6aacfedbce44d7748cf7c49cd2b949952f2e427 | [
"MIT"
] | null | null | null | sk_typing/multiclass.py | thomasjpfan/sk_typing | e6aacfedbce44d7748cf7c49cd2b949952f2e427 | [
"MIT"
] | null | null | null | from typing import Optional
from .typing import EstimatorType
from .typing import RandomStateType
| 21.961538 | 79 | 0.660245 | from typing import Optional
from .typing import EstimatorType
from .typing import RandomStateType
class OneVsOneClassifier:
def __init__(self, estimator: EstimatorType, n_jobs: Optional[int] = None):
...
class OneVsRestClassifier:
def __init__(self, estimator: EstimatorType, n_jobs: Optional[int] =... | 307 | 15 | 147 |
312989e96aa3afbadf1c5a1b5444926242166e7f | 750 | py | Python | example.py | ag14774/rph | c46bbac9ff90e781784d7b342047c7299c01e708 | [
"MIT"
] | 1 | 2020-06-25T08:49:16.000Z | 2020-06-25T08:49:16.000Z | example.py | ag14774/rph | c46bbac9ff90e781784d7b342047c7299c01e708 | [
"MIT"
] | null | null | null | example.py | ag14774/rph | c46bbac9ff90e781784d7b342047c7299c01e708 | [
"MIT"
] | null | null | null | import torch
from rph import RandomProjectionHashModule
if __name__ == '__main__':
s1 = "AAATGCGGATGT"
s2 = "TAATGCGGATGT"
d = {
"AA": 0,
"AC": 1,
"AT": 2,
"AG": 3,
"CA": 4,
"CC": 5,
"CT": 6,
"CG": 7,
"TA": 8,
"TC": 9,
... | 21.428571 | 61 | 0.424 | import torch
from rph import RandomProjectionHashModule
if __name__ == '__main__':
s1 = "AAATGCGGATGT"
s2 = "TAATGCGGATGT"
d = {
"AA": 0,
"AC": 1,
"AT": 2,
"AG": 3,
"CA": 4,
"CC": 5,
"CT": 6,
"CG": 7,
"TA": 8,
"TC": 9,
... | 0 | 0 | 0 |
3903df6c675b459ae22ff986273c0eb1a3725c3e | 2,789 | py | Python | kombu/transport/__init__.py | abourget/kombu | ed67ff19660d43cb91274286b03254cc0160b6c3 | [
"BSD-3-Clause"
] | 2 | 2017-06-02T10:18:09.000Z | 2019-06-14T08:48:02.000Z | kombu/transport/__init__.py | abourget/kombu | ed67ff19660d43cb91274286b03254cc0160b6c3 | [
"BSD-3-Clause"
] | null | null | null | kombu/transport/__init__.py | abourget/kombu | ed67ff19660d43cb91274286b03254cc0160b6c3 | [
"BSD-3-Clause"
] | null | null | null | """
kombu.transport
===============
Built-in transports.
:copyright: (c) 2009 - 2010 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
import sys
from kombu.utils import rpartition
DEFAULT_TRANSPORT = "kombu.transport.pyamqplib.Transport"
MISSING_LIB = """
The %(feature)s requires the %(lib)s mod... | 28.459184 | 77 | 0.69308 | """
kombu.transport
===============
Built-in transports.
:copyright: (c) 2009 - 2010 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
import sys
from kombu.utils import rpartition
DEFAULT_TRANSPORT = "kombu.transport.pyamqplib.Transport"
MISSING_LIB = """
The %(feature)s requires the %(lib)s mod... | 1,097 | 0 | 115 |
351900524321c5a20de80aba9529387be17878c1 | 402 | py | Python | Motor_Imagery/neuropype_recieve.py | OpenBCI/OpenBCI_Tutorials | 8db159b616c11849100f0444ea7071ff3ab02e72 | [
"MIT"
] | 11 | 2021-02-12T20:01:25.000Z | 2022-02-09T20:37:59.000Z | Motor_Imagery/neuropype_recieve.py | evaesteban/OpenBCI_Tutorials | 8db159b616c11849100f0444ea7071ff3ab02e72 | [
"MIT"
] | null | null | null | Motor_Imagery/neuropype_recieve.py | evaesteban/OpenBCI_Tutorials | 8db159b616c11849100f0444ea7071ff3ab02e72 | [
"MIT"
] | 2 | 2021-03-29T08:23:10.000Z | 2021-09-12T10:57:48.000Z | # Code written by Rakesh C Jakati for the Motor Imagery tutorial
from oscpy.server import OSCThreadServer
from time import sleep
from oscpy.client import OSCClient
osc = OSCThreadServer()
sock = osc.listen(address='127.0.0.1', port=9002, default=True)
@osc.address(b'/neuropype')
sleep(100)
| 28.714286 | 80 | 0.753731 | # Code written by Rakesh C Jakati for the Motor Imagery tutorial
from oscpy.server import OSCThreadServer
from time import sleep
from oscpy.client import OSCClient
osc = OSCThreadServer()
sock = osc.listen(address='127.0.0.1', port=9002, default=True)
@osc.address(b'/neuropype')
def callback(left, right):
print("Le... | 86 | 0 | 22 |
a6431c09e9265cc6ed66c25a6cddd99959cbe072 | 8,971 | py | Python | pylxd/tests/models/test_network.py | kissiel/pylxd | a637209a67e7f32c17ecdbf774d8968794e03d25 | [
"Apache-2.0"
] | null | null | null | pylxd/tests/models/test_network.py | kissiel/pylxd | a637209a67e7f32c17ecdbf774d8968794e03d25 | [
"Apache-2.0"
] | null | null | null | pylxd/tests/models/test_network.py | kissiel/pylxd | a637209a67e7f32c17ecdbf774d8968794e03d25 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 31.25784 | 79 | 0.517334 | # Copyright (c) 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 4,045 | 0 | 344 |
0ea97349494743ec080348d3fe7c9e5b69acb902 | 562 | py | Python | src/python/run_sim.py | ibraaaa/news-credibility | cae1009d9def17c058342c3dee969f2babcd0c9e | [
"Apache-2.0"
] | null | null | null | src/python/run_sim.py | ibraaaa/news-credibility | cae1009d9def17c058342c3dee969f2babcd0c9e | [
"Apache-2.0"
] | null | null | null | src/python/run_sim.py | ibraaaa/news-credibility | cae1009d9def17c058342c3dee969f2babcd0c9e | [
"Apache-2.0"
] | null | null | null | import traceback
try:
import signals.sim_server as sim
import signals.sentiment as sentiment
import sys
server = sim.SimServer('/home/ibraaaa/servers/1mon_preprocess/')
result = server.query(sys.argv[1])
result = server.rank(result[0], result[1])
for r in result:
sentimen... | 37.466667 | 120 | 0.629893 | import traceback
try:
import signals.sim_server as sim
import signals.sentiment as sentiment
import sys
server = sim.SimServer('/home/ibraaaa/servers/1mon_preprocess/')
result = server.query(sys.argv[1])
result = server.rank(result[0], result[1])
for r in result:
sentimen... | 0 | 0 | 0 |
529a5f07b9e66640be524601d40f869f6cbfced5 | 87 | py | Python | ib_insync/version.py | toledy/ib_insync | 301431b2ff61b39af1be39476804df535d2419f9 | [
"BSD-2-Clause"
] | null | null | null | ib_insync/version.py | toledy/ib_insync | 301431b2ff61b39af1be39476804df535d2419f9 | [
"BSD-2-Clause"
] | null | null | null | ib_insync/version.py | toledy/ib_insync | 301431b2ff61b39af1be39476804df535d2419f9 | [
"BSD-2-Clause"
] | null | null | null | __version_info__ = (0, 9, 34)
__version__ = '.'.join(str(v) for v in __version_info__)
| 29 | 56 | 0.701149 | __version_info__ = (0, 9, 34)
__version__ = '.'.join(str(v) for v in __version_info__)
| 0 | 0 | 0 |