hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | 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 130 | 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 130 | 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.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bdb730d0f50430d110a115cc03dfcb6409642f00 | 1,184 | py | Python | utils/utils.py | gtdelong/teamwork | 0064d6d08102e054bf8175318060ce30e5dbe398 | [
"MIT"
] | null | null | null | utils/utils.py | gtdelong/teamwork | 0064d6d08102e054bf8175318060ce30e5dbe398 | [
"MIT"
] | null | null | null | utils/utils.py | gtdelong/teamwork | 0064d6d08102e054bf8175318060ce30e5dbe398 | [
"MIT"
] | null | null | null |
columns = ['discharge_id',
'avg_clust',
'cumulative_experience',
'avg_cumulative_experience',
'team_edge_size',
'team_size']
notes_with_disposition_file = '../data/notes_w_disposition.csv'
discharges_with_disposition_file = '../data/discharges_w_disposition.csv' | 39.466667 | 133 | 0.714527 | import networkx as nx
columns = ['discharge_id',
'avg_clust',
'cumulative_experience',
'avg_cumulative_experience',
'team_edge_size',
'team_size']
def get_careteam_data(care_team):
data = {}
data['discharge_id'] = care_team.discharge_id
''' Clustering coefficie... | 0 | 0 | 0 | 0 | 0 | 835 | 0 | 0 | 45 |
64adb66d1de32f834247aafc8d5c406ee1fbaf6d | 473 | py | Python | 03 Web/Web 02/app.py | culee/c4e | 775c53fa92a31696431760f58a79a52889bfb46f | [
"MIT"
] | null | null | null | 03 Web/Web 02/app.py | culee/c4e | 775c53fa92a31696431760f58a79a52889bfb46f | [
"MIT"
] | null | null | null | 03 Web/Web 02/app.py | culee/c4e | 775c53fa92a31696431760f58a79a52889bfb46f | [
"MIT"
] | null | null | null | from flask import Flask
import mlab
app = Flask(__name__)
mlab.connect()
if __name__ == '__main__':
app.run(debug=True)
| 22.52381 | 96 | 0.727273 | from flask import Flask, render_template
from models.service import Service
import mlab
app = Flask(__name__)
mlab.connect()
@app.route('/')
def index():
return render_template("index.html")
@app.route('/search/<int:gender>')
def search(gender):
all_services = Service.objects(gender = gender, yob__lte = 19... | 0 | 250 | 0 | 0 | 0 | 0 | 0 | 30 | 68 |
4dccb1062f8858f4ce7a8dd67ec93b8c1f9240fe | 9,086 | py | Python | venv/lib/python3.9/site-packages/google/auth/transport/_mtls_helper.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 348 | 2018-10-14T17:48:33.000Z | 2022-03-22T06:53:03.000Z | venv/lib/python3.9/site-packages/google/auth/transport/_mtls_helper.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 485 | 2018-10-23T19:07:47.000Z | 2022-03-31T13:59:03.000Z | venv/lib/python3.9/site-packages/google/auth/transport/_mtls_helper.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 229 | 2018-10-17T20:10:03.000Z | 2022-02-25T22:47:49.000Z | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 35.631373 | 88 | 0.696676 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9ae40e86a390b81208bf833d1832883268bb2344 | 131 | py | Python | lib/JumpScale/baselib/git/__init__.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | 1 | 2015-10-26T10:38:13.000Z | 2015-10-26T10:38:13.000Z | lib/JumpScale/baselib/git/__init__.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | null | null | null | lib/JumpScale/baselib/git/__init__.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | null | null | null | from JumpScale import j
from GitFactory import GitFactory
j.base.loader.makeAvailable(j, 'clients')
j.clients.git = GitFactory()
| 18.714286 | 41 | 0.78626 | from JumpScale import j
from GitFactory import GitFactory
j.base.loader.makeAvailable(j, 'clients')
j.clients.git = GitFactory()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a282ddc7e78647c0b19ffb8ad348740a358fe7f0 | 179 | py | Python | djangobench_webui/webui/urls.py | sebleier/djangobench-webui | d35bdc72c0fe2775b453f3142853d33cdb1a05bf | [
"BSD-3-Clause"
] | 2 | 2015-11-08T11:31:36.000Z | 2020-09-23T08:49:59.000Z | djangobench_webui/webui/urls.py | sebleier/djangobench-webui | d35bdc72c0fe2775b453f3142853d33cdb1a05bf | [
"BSD-3-Clause"
] | null | null | null | djangobench_webui/webui/urls.py | sebleier/djangobench-webui | d35bdc72c0fe2775b453f3142853d33cdb1a05bf | [
"BSD-3-Clause"
] | null | null | null |
urlpatterns = patterns('djangobench_webui.webui.views',
(r'^$', 'results'),
(r'^data/(?P<benchmark>\w+)/$', 'benchmark_data'),
)
| 22.375 | 55 | 0.648045 | from django.conf.urls.defaults import *
urlpatterns = patterns('djangobench_webui.webui.views',
(r'^$', 'results'),
(r'^data/(?P<benchmark>\w+)/$', 'benchmark_data'),
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 22 |
27235ce27a42c159e44c63aa2e66e67608612027 | 6,863 | py | Python | python36/06_fou/BSM_option_valuation_FOU.py | aborodya/dawp | 0b34507e4b09eda677815728b46d800eedfeba3d | [
"CNRI-Python"
] | 484 | 2015-08-04T19:24:06.000Z | 2022-03-30T20:59:30.000Z | python36/06_fou/BSM_option_valuation_FOU.py | aborodya/dawp | 0b34507e4b09eda677815728b46d800eedfeba3d | [
"CNRI-Python"
] | 3 | 2019-09-10T14:37:30.000Z | 2019-09-10T14:37:45.000Z | python36/06_fou/BSM_option_valuation_FOU.py | aborodya/dawp | 0b34507e4b09eda677815728b46d800eedfeba3d | [
"CNRI-Python"
] | 360 | 2015-08-08T03:30:37.000Z | 2022-03-30T12:07:31.000Z | #
# Valuation of European Call Options in BSM Model
# Comparison of Analytical, int_valueegral and FFT Approach
# 11_cal/BSM_option_valuation_FOU.py
#
# (c) Dr. Yves J. Hilpisch
# Derivatives Analytics with Python
#
import numpy as np
from numpy.fft import fft
from scipy.integrate import quad
from scipy import stats
im... | 30.914414 | 79 | 0.544514 | #
# Valuation of European Call Options in BSM Model
# Comparison of Analytical, int_valueegral and FFT Approach
# 11_cal/BSM_option_valuation_FOU.py
#
# (c) Dr. Yves J. Hilpisch
# Derivatives Analytics with Python
#
import numpy as np
from numpy.fft import fft
from scipy.integrate import quad
from scipy import stats
im... | 0 | 0 | 0 | 0 | 0 | 1,143 | 0 | 10 | 45 |
58d0e62dee253b95881bc5f3229bd2f3c5bda71f | 2,366 | py | Python | skimage/transform/seam_carving.py | silverneko/scikit-image | 1f8c74f69e0f9e72c59f180b2fc96d311659c609 | [
"BSD-3-Clause"
] | null | null | null | skimage/transform/seam_carving.py | silverneko/scikit-image | 1f8c74f69e0f9e72c59f180b2fc96d311659c609 | [
"BSD-3-Clause"
] | 5 | 2016-05-23T22:14:40.000Z | 2022-02-25T21:10:23.000Z | skimage/transform/seam_carving.py | silverneko/scikit-image | 1f8c74f69e0f9e72c59f180b2fc96d311659c609 | [
"BSD-3-Clause"
] | 2 | 2016-05-23T08:44:29.000Z | 2021-06-23T00:26:23.000Z | from ._seam_carving import _seam_carve_v
from .. import util
from .._shared import utils
import numpy as np
def seam_carve(image, energy_map, mode, num, border=1, force_copy=True):
""" Carve vertical or horizontal seams off an image.
Carves out vertical/horizontal seams from an image while using the given
... | 35.313433 | 77 | 0.658918 | from ._seam_carving import _seam_carve_v
from .. import util
from .._shared import utils
import numpy as np
def seam_carve(image, energy_map, mode, num, border=1, force_copy=True):
""" Carve vertical or horizontal seams off an image.
Carves out vertical/horizontal seams from an image while using the given
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fc9d2314d890340ab7d76e77152169ce431a72b6 | 617 | py | Python | python/qipkg/package.py | aldebaran/qibuild | efea6fa3744664348717fe5e8df708a3cf392072 | [
"BSD-3-Clause"
] | 51 | 2015-01-05T14:35:13.000Z | 2021-07-27T06:46:59.000Z | python/qipkg/package.py | aldebaran/qibuild | efea6fa3744664348717fe5e8df708a3cf392072 | [
"BSD-3-Clause"
] | 104 | 2015-04-09T10:48:42.000Z | 2020-09-16T16:33:29.000Z | python/qipkg/package.py | aldebaran/qibuild | efea6fa3744664348717fe5e8df708a3cf392072 | [
"BSD-3-Clause"
] | 46 | 2015-01-05T14:35:16.000Z | 2022-02-13T20:39:36.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" QiBuild """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print... | 29.380952 | 84 | 0.742301 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" QiBuild """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b06fdcd14499acc5ce6a59058b2073b5d9838671 | 2,875 | py | Python | e2e-test/seleniume2e.py | elastest/elastest-bigdata-service | 7cc237b68e900852367a1f79ade9b9a85bea1b37 | [
"Apache-2.0"
] | null | null | null | e2e-test/seleniume2e.py | elastest/elastest-bigdata-service | 7cc237b68e900852367a1f79ade9b9a85bea1b37 | [
"Apache-2.0"
] | 2 | 2018-01-05T13:46:48.000Z | 2018-02-28T10:10:04.000Z | e2e-test/seleniume2e.py | elastest/elastest-bigdata-service | 7cc237b68e900852367a1f79ade9b9a85bea1b37 | [
"Apache-2.0"
] | 7 | 2017-09-20T11:20:16.000Z | 2018-05-28T17:48:36.000Z | ######################
# Author: Nick Gavalas
# 2/3/2019 fixed by Kimon Moschandreou
######################
import time
import sys
import os
from selenium import webdriver
# TODO: Substitute timers with webdriverwaits.
url = sys.argv[1]
projectname = 'deleteme'
tjobname = 'deletethisproject'
tjobimage = 'elastest/ebs... | 33.045977 | 158 | 0.745391 | ######################
# Author: Nick Gavalas
# 2/3/2019 fixed by Kimon Moschandreou
######################
import time
import sys
import os
import selenium
from selenium import webdriver
# TODO: Substitute timers with webdriverwaits.
url = sys.argv[1]
projectname = 'deleteme'
tjobname = 'deletethisproject'
tjobimage... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -6 | 22 |
62adad74c41ea11934ec0fd48ae7847cccb172be | 5,878 | py | Python | record_demo.py | LuoYouRen/gym-atari-demostrations-collector | 7ecc5c0bb3d0c46fb785098911a50cb72499eb58 | [
"MIT"
] | 1 | 2019-01-02T13:41:29.000Z | 2019-01-02T13:41:29.000Z | record_demo.py | LuoYouRen/gym-atari-demostrations-collector | 7ecc5c0bb3d0c46fb785098911a50cb72499eb58 | [
"MIT"
] | null | null | null | record_demo.py | LuoYouRen/gym-atari-demostrations-collector | 7ecc5c0bb3d0c46fb785098911a50cb72499eb58 | [
"MIT"
] | null | null | null | import os
import argparse
import numpy as np
import gym
from gym.envs.atari.atari_env import ACTION_MEANING
import pygame
from atari_demo.wrappers import AtariDemo
import time
parser = argparse.ArgumentParser()
parser.add_argument('-g', '--game', type=str, default='MontezumaRevenge')
parser.add_argument('-f', '--frame... | 33.397727 | 119 | 0.624872 | import os
import argparse
import numpy as np
import gym
from gym.envs.atari.atari_env import ACTION_MEANING
import pygame
from atari_demo.wrappers import AtariDemo
from atari_demo.utils import *
import time
parser = argparse.ArgumentParser()
parser.add_argument('-g', '--game', type=str, default='MontezumaRevenge')
par... | 0 | 0 | 0 | 0 | 0 | 2,172 | 0 | 9 | 159 |
03316fedbb68c8a67ecaf3df756e36001ea18aaa | 2,983 | py | Python | features/extraction/lib/config.py | bayesimpact/readmission-risk | 5b0f6c93826601e2dbb9c8c276e92801772e17c4 | [
"Apache-2.0"
] | 19 | 2016-10-06T18:10:36.000Z | 2018-04-04T02:30:09.000Z | features/extraction/lib/config.py | BeaconLabs/readmission-risk | 5b0f6c93826601e2dbb9c8c276e92801772e17c4 | [
"Apache-2.0"
] | 2 | 2017-10-26T19:22:58.000Z | 2017-11-16T07:44:58.000Z | features/extraction/lib/config.py | bayesimpact/readmission-risk | 5b0f6c93826601e2dbb9c8c276e92801772e17c4 | [
"Apache-2.0"
] | 9 | 2016-11-15T14:13:20.000Z | 2021-12-19T20:27:58.000Z | """Methods for dealing with configuration files."""
import os
try:
import ujson as json
except ImportError:
import sutter
config_ = None
def get(key, default=None):
"""
Fetch a configuration variable, returning `default` if the key does not exist.
:param key: Variable key, possibly nested via `.`... | 28.409524 | 89 | 0.629903 | """Methods for dealing with configuration files."""
import os
try:
import ujson as json
except ImportError:
import json
import sutter
config_ = None
class Config(object):
"""
An internal representation of a configuration file.
Handles multiple possible config sources (path or env var) and nest... | 0 | 422 | 0 | 1,228 | 0 | 0 | 0 | -10 | 49 |
25c411d2c3aea45cb21b2da89e3b5a8bcd29de57 | 1,886 | py | Python | pygments_arm/__init__.py | heia-fr/pygments-arm | 1b0184e9911e5f01a0a5c22c8bc900beb4f27866 | [
"Apache-2.0"
] | null | null | null | pygments_arm/__init__.py | heia-fr/pygments-arm | 1b0184e9911e5f01a0a5c22c8bc900beb4f27866 | [
"Apache-2.0"
] | 1 | 2019-11-27T13:53:53.000Z | 2019-11-29T08:20:31.000Z | pygments_arm/__init__.py | heia-fr/pygments-arm | 1b0184e9911e5f01a0a5c22c8bc900beb4f27866 | [
"Apache-2.0"
] | 1 | 2021-11-13T01:08:57.000Z | 2021-11-13T01:08:57.000Z | # -*- coding: utf-8 -*-
"""
ARM lexer
~~~~~~~~~
Pygments lexer for ARM Assembly.
:copyright: Copyright 2017 Jacques Supcik
:license: Apache 2, see LICENSE for details.
"""
__all__ = ['ArmLexer']
| 28.149254 | 75 | 0.436903 | # -*- coding: utf-8 -*-
"""
ARM lexer
~~~~~~~~~
Pygments lexer for ARM Assembly.
:copyright: Copyright 2017 Jacques Supcik
:license: Apache 2, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include
from pygments.token import Text, Name, Number, String, Comment, Punctuation
_... | 0 | 0 | 0 | 1,521 | 0 | 0 | 0 | 79 | 68 |
7ea1ba29e3018144f795159f181ead2fd16f4bf5 | 930 | py | Python | rr/test/test_nyrr.py | Habstinat/py-race-results | 370981d12e2c65d5658d96b4e2533edbbb495001 | [
"MIT"
] | 1 | 2017-01-31T19:49:53.000Z | 2017-01-31T19:49:53.000Z | rr/test/test_nyrr.py | hpr/py-race-results | 370981d12e2c65d5658d96b4e2533edbbb495001 | [
"MIT"
] | null | null | null | rr/test/test_nyrr.py | hpr/py-race-results | 370981d12e2c65d5658d96b4e2533edbbb495001 | [
"MIT"
] | null | null | null | import unittest
if __name__ == "__main__":
unittest.main()
| 22.682927 | 70 | 0.530108 | import datetime
import os
import sys
import tempfile
import unittest
import rr
class TestNYRR(unittest.TestCase):
def setUp(self):
self.results_file = tempfile.NamedTemporaryFile(suffix=".txt")
def tearDown(self):
pass
def test_web_download(self):
"""
Verify that we can... | 0 | 0 | 0 | 777 | 0 | 0 | 0 | -47 | 134 |
c4eeb968a1108c4d6fa58977b945ef04a51e25b2 | 2,441 | py | Python | custom_components/xiaomi_gateway3/core/shell/shell_e1.py | zvldz/homeassistant | becbe7087e3cf152cce2f9bb3670e3a0a283fc79 | [
"BSD-2-Clause"
] | 13 | 2019-06-04T12:23:25.000Z | 2021-11-23T17:24:27.000Z | custom_components/xiaomi_gateway3/core/shell/shell_e1.py | zvldz/homeassistant | becbe7087e3cf152cce2f9bb3670e3a0a283fc79 | [
"BSD-2-Clause"
] | 1 | 2020-10-22T11:14:24.000Z | 2020-10-22T18:36:30.000Z | custom_components/xiaomi_gateway3/core/shell/shell_e1.py | zvldz/homeassistant | becbe7087e3cf152cce2f9bb3670e3a0a283fc79 | [
"BSD-2-Clause"
] | 1 | 2020-08-25T18:41:34.000Z | 2020-08-25T18:41:34.000Z |
TAR_DATA = "tar -czOC /data mha_master miio storage zigbee devices.txt gatewayInfoJson.info 2>/dev/null | base64"
| 31.701299 | 114 | 0.615731 | import asyncio
import base64
from .base import TelnetShell
TAR_DATA = "tar -czOC /data mha_master miio storage zigbee devices.txt gatewayInfoJson.info 2>/dev/null | base64"
class ShellE1(TelnetShell):
model = "e1"
async def login(self):
self.writer.write(b"root\n")
await asyncio.sleep(.1)
... | 0 | 0 | 1,868 | 374 | 0 | 0 | 0 | -7 | 90 |
b6c3eeccff4dedf4fa25418645a523df346851b7 | 3,048 | py | Python | net/data.py | PuchatekwSzortach/printed_characters_net | 9478d4ecffeca040cc353676382d0ec775558458 | [
"MIT"
] | 1 | 2018-05-31T00:20:24.000Z | 2018-05-31T00:20:24.000Z | net/data.py | PuchatekwSzortach/printed_characters_net | 9478d4ecffeca040cc353676382d0ec775558458 | [
"MIT"
] | null | null | null | net/data.py | PuchatekwSzortach/printed_characters_net | 9478d4ecffeca040cc353676382d0ec775558458 | [
"MIT"
] | null | null | null | """
Module with code related to creating data.
"""
import PIL.Image
import PIL.ImageDraw
| 35.034483 | 109 | 0.668963 | """
Module with code related to creating data.
"""
import PIL.Image
import PIL.ImageDraw
import PIL.ImageFont
import numpy as np
import cv2
import net.printing
class TemplatesMaker:
"""
Class for creating plain images of characters.
Plain image is defined as a simple black character on white background.... | 0 | 0 | 0 | 2,862 | 0 | 0 | 0 | -17 | 112 |
da4c6fd148be2d1a80cadce7e49b5d13c10f20a5 | 3,413 | py | Python | back-end/src/handler/model/base/base.py | gfxcc/san11-platform-back-end | 74f60d201e21396c5c8601ddc404077ebd97871f | [
"MIT"
] | 1 | 2022-03-13T04:24:00.000Z | 2022-03-13T04:24:00.000Z | back-end/src/handler/model/base/base.py | gfxcc/san11-platform-back-end | 74f60d201e21396c5c8601ddc404077ebd97871f | [
"MIT"
] | null | null | null | back-end/src/handler/model/base/base.py | gfxcc/san11-platform-back-end | 74f60d201e21396c5c8601ddc404077ebd97871f | [
"MIT"
] | null | null | null | import datetime
from typing import Any, Dict, List, Optional
import attr
from . import base_core, base_db, base_proto
def Attrib(
# proto section
is_proto_field: bool = True,
proto_path: Optional[str] = None,
proto_converter: Optional[base_proto.ProtoConverter] = None,
# db s... | 35.926316 | 103 | 0.670964 | import datetime
from typing import Any, Callable, Dict, List, Optional, TypedDict, TypeVar
import attr
from . import base_core, base_db, base_proto
def Attrib(
# proto section
is_proto_field: bool = True,
proto_path: Optional[str] = None,
proto_converter: Optional[base_proto.ProtoCon... | 0 | 0 | 0 | 0 | 0 | 293 | 0 | 30 | 23 |
ab6709ada1d832ede7e4a729032186ea8934f7cc | 183 | py | Python | StackApp/qanda/admin.py | ArsalanShahid116/StackDuplica | 77a35624e61147c7ea3f89ca135744c152f3afdb | [
"MIT"
] | 1 | 2022-02-22T09:16:51.000Z | 2022-02-22T09:16:51.000Z | StackApp/qanda/admin.py | ArsalanShahid116/StackDuplica | 77a35624e61147c7ea3f89ca135744c152f3afdb | [
"MIT"
] | null | null | null | StackApp/qanda/admin.py | ArsalanShahid116/StackDuplica | 77a35624e61147c7ea3f89ca135744c152f3afdb | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Question, Answer, Scrapedquestion
admin.site.register(Question)
admin.site.register(Answer)
admin.site.register(Scrapedquestion)
| 26.142857 | 53 | 0.836066 | from django.contrib import admin
from .models import Question, Answer, Scrapedquestion
admin.site.register(Question)
admin.site.register(Answer)
admin.site.register(Scrapedquestion)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
11991c56f6a7b09f2c92a781cdac2f3175fd1a8e | 17 | py | Python | Random-Programs/dev/games/terminal/networking.py | naumoff0/Archive | d4ad2da89abb1576dd5a7c72ded6bf9b45c3f610 | [
"MIT"
] | null | null | null | Random-Programs/dev/games/terminal/networking.py | naumoff0/Archive | d4ad2da89abb1576dd5a7c72ded6bf9b45c3f610 | [
"MIT"
] | null | null | null | Random-Programs/dev/games/terminal/networking.py | naumoff0/Archive | d4ad2da89abb1576dd5a7c72ded6bf9b45c3f610 | [
"MIT"
] | null | null | null | axI=njPq | 17 | 17 | 0.588235 | axI=n°²ÂjPÀq | 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0fb98d58bbc4543349973ce90e10e9d3e77907d4 | 2,049 | py | Python | CompareKaro/Crawlers/views.py | sumeet-dang/CompareKaro | 296d925d6eea1de6434cc826bfc1f01f4dbc2964 | [
"Apache-2.0"
] | null | null | null | CompareKaro/Crawlers/views.py | sumeet-dang/CompareKaro | 296d925d6eea1de6434cc826bfc1f01f4dbc2964 | [
"Apache-2.0"
] | null | null | null | CompareKaro/Crawlers/views.py | sumeet-dang/CompareKaro | 296d925d6eea1de6434cc826bfc1f01f4dbc2964 | [
"Apache-2.0"
] | null | null | null |
# Create your views here.
| 47.651163 | 357 | 0.693997 | from django.shortcuts import render
from Crawlers.Helpers.amazon_crawler import amazon_crawl
from django import template
from Crawlers.Helpers.snapdeal_crawler import snapdeal_crawl
from Crawlers.Helpers.ebay_crawler import ebay_crawl
# Create your views here.
def load_sources(request):
if(request.method == "POS... | 0 | 0 | 0 | 0 | 0 | 1,763 | 0 | 125 | 132 |
e05213659f89771bab7bbf34fd7cc5f84d4dccf0 | 906 | py | Python | userbot/plugins/alive.py | Kambojr15/TechnoAyanBOT | 24561eae30f5645b0eb6c66ddf87189894fc07d5 | [
"MIT"
] | null | null | null | userbot/plugins/alive.py | Kambojr15/TechnoAyanBOT | 24561eae30f5645b0eb6c66ddf87189894fc07d5 | [
"MIT"
] | null | null | null | userbot/plugins/alive.py | Kambojr15/TechnoAyanBOT | 24561eae30f5645b0eb6c66ddf87189894fc07d5 | [
"MIT"
] | null | null | null | """Check if userbot alive. If you change these, you become the gayest gay such that even the gay world will disown you."""
from userbot import ALIVE_NAME
DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Set ALIVE_NAME in config vars in Heroku"
| 50.333333 | 167 | 0.639073 | """Check if userbot alive. If you change these, you become the gayest gay such that even the gay world will disown you."""
import asyncio
from telethon import events
from telethon.tl.types import ChannelParticipantsAdmins
from platform import uname
from userbot import ALIVE_NAME
from userbot.utils import admin_cmd
DEF... | 162 | 421 | 0 | 0 | 0 | 0 | 0 | 52 | 133 |
ffba298880bd79f4ce56feec80bb2e1c9bfdcf61 | 1,371 | py | Python | setup.py | dcslagel/lascheck | 4df427a56db14d8e0c64ccea852f1c3e6460e416 | [
"MIT"
] | 8 | 2020-01-27T19:29:37.000Z | 2021-10-02T17:55:01.000Z | setup.py | dcslagel/lascheck | 4df427a56db14d8e0c64ccea852f1c3e6460e416 | [
"MIT"
] | 7 | 2020-06-18T11:42:50.000Z | 2020-09-27T13:22:51.000Z | setup.py | dcslagel/lascheck | 4df427a56db14d8e0c64ccea852f1c3e6460e416 | [
"MIT"
] | 6 | 2020-05-16T14:03:27.000Z | 2021-08-05T15:00:29.000Z | '''Setup script for lascheck'''
from setuptools import setup
__version__ = '0.1.4'
CLASSIFIERS = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: End Users/Desktop",
"Intended A... | 31.883721 | 95 | 0.615609 | '''Setup script for lascheck'''
from setuptools import setup
__version__ = '0.1.4'
CLASSIFIERS = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: End Users/Desktop",
"Intended A... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9c06108b1212058570739f0790391154d5bfc6a8 | 1,440 | py | Python | miner.py | vijayRT/inkbot | d0b027d02a3b586ec818874eaeb2dc3371276ae3 | [
"MIT"
] | 1 | 2017-03-12T18:59:46.000Z | 2017-03-12T18:59:46.000Z | miner.py | Kronosfear/inkbot | d0b027d02a3b586ec818874eaeb2dc3371276ae3 | [
"MIT"
] | null | null | null | miner.py | Kronosfear/inkbot | d0b027d02a3b586ec818874eaeb2dc3371276ae3 | [
"MIT"
] | null | null | null |
#tweepy1.py - To test trend obtaining
import sys
sys.path.append('/home/vijay/.local/lib/python2.7/site-packages')
import tweepy
import time
import sys
reload(sys)
#Configure Tweepy API
t0 = time.time()
consumer_key = 'Osyy0PSrhMRpnIWxjBLzLJeKR'
consumer_secret = 'AYY7Qb48yl2gk4GacSmnWTrv6keikGpMAsPZaamKIRNoWYqz... | 23.225806 | 70 | 0.688194 |
#tweepy1.py - To test trend obtaining
import sys
sys.path.append('/home/vijay/.local/lib/python2.7/site-packages')
import tweepy
import woeid
import yweather
import time
import os
import sys
reload(sys)
#Configure Tweepy API
t0 = time.time()
consumer_key = 'Osyy0PSrhMRpnIWxjBLzLJeKR'
consumer_secret = 'AYY7Qb48y... | 0 | 0 | 0 | 0 | 0 | 507 | 0 | -27 | 89 |
b978e3a842f375a5d74e1d9dd4c49ae33cea9d21 | 4,184 | py | Python | aysa/common/counters.py | aysa-sa/common | 07dd6d219eac8c0c73d9bc04e6cc163529c1801b | [
"MIT"
] | null | null | null | aysa/common/counters.py | aysa-sa/common | 07dd6d219eac8c0c73d9bc04e6cc163529c1801b | [
"MIT"
] | null | null | null | aysa/common/counters.py | aysa-sa/common | 07dd6d219eac8c0c73d9bc04e6cc163529c1801b | [
"MIT"
] | null | null | null | # Author: Alejandro M. BERNARDIS
# Email alejandro.bernardis at gmail.com
# Created: 2019/11/23 08:53
# El ejemplo fue tomado de: https://github.com/viewfinderco/viewfinder
global_manager = CounterManager()
| 27.346405 | 79 | 0.595124 | # Author: Alejandro M. BERNARDIS
# Email alejandro.bernardis at gmail.com
# Created: 2019/11/23 08:53
# El ejemplo fue tomado de: https://github.com/viewfinderco/viewfinder
import time
from dotted.collection import DottedDict
class Counter:
def __init__(self, name, factor=1, reset=0, tmpl=None, **kwargs):
... | 0 | 220 | 0 | 3,053 | 0 | 407 | 0 | 9 | 275 |
b1c62dec44d97791bec06669fdcfa02b9fa21b07 | 7,707 | py | Python | src/perforce/GUI/OpenedFilesWindow.py | TomMinor/P4VFX | b9a8100423fa4cc0c5bb700f0a2656868bc0a86e | [
"MIT"
] | 41 | 2017-05-26T01:46:04.000Z | 2022-03-20T06:59:18.000Z | src/AppPlugins/P4Houdini/python2.7libs/perforce/GUI/OpenedFilesWindow.py | TomMinor/P4VFX | b9a8100423fa4cc0c5bb700f0a2656868bc0a86e | [
"MIT"
] | 3 | 2017-05-26T02:31:17.000Z | 2019-04-22T15:47:27.000Z | src/AppPlugins/P4Houdini/python2.7libs/perforce/GUI/OpenedFilesWindow.py | TomMinor/P4VFX | b9a8100423fa4cc0c5bb700f0a2656868bc0a86e | [
"MIT"
] | 11 | 2017-09-18T05:36:19.000Z | 2022-02-24T21:52:27.000Z |
import perforce.Utils as Utils | 33.951542 | 80 | 0.593746 | import os
from P4 import P4, P4Exception
from qtpy import QtCore, QtGui, QtWidgets
import perforce.Utils as Utils
from perforce.AppInterop import interop
class OpenedFilesUI(QtWidgets.QDialog):
def __init__(self, parent=interop.main_parent_window()):
super(OpenedFilesUI, self).__init__(parent)
def ... | 0 | 0 | 0 | 7,529 | 0 | 0 | 0 | 35 | 112 |
54b9cfda91f6b65cb9044b164460272963964133 | 8,281 | py | Python | examples/notepad/notepad/forms/main_window_ui.py | haesleinhuepf/pyqode.core | 88b9bab081fd580d4de86f3d926a9f0b19146d28 | [
"MIT"
] | null | null | null | examples/notepad/notepad/forms/main_window_ui.py | haesleinhuepf/pyqode.core | 88b9bab081fd580d4de86f3d926a9f0b19146d28 | [
"MIT"
] | null | null | null | examples/notepad/notepad/forms/main_window_ui.py | haesleinhuepf/pyqode.core | 88b9bab081fd580d4de86f3d926a9f0b19146d28 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/Users/Colin/Documents/pyqode/core/examples/notepad/forms/main_window.ui'
#
# Created by: PyQt5 UI code generator 5.4.1
#
# WARNING! All changes made in this file will be lost! | 54.480263 | 127 | 0.711871 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/Users/Colin/Documents/pyqode/core/examples/notepad/forms/main_window.ui'
#
# Created by: PyQt5 UI code generator 5.4.1
#
# WARNING! All changes made in this file will be lost!
from qtpy import QtCore, QtGui, QtWidgets
class Ui_MainWindow(... | 0 | 0 | 0 | 7,852 | 0 | 0 | 0 | 83 | 91 |
a501332432ad53edb9caa6db93033d52b8260516 | 221 | py | Python | itertools-permutations.py | 0xecho/HackerRankSolutions | 2d525ca9f13297cbee0191e2c14a04208cb97a69 | [
"BSD-3-Clause"
] | null | null | null | itertools-permutations.py | 0xecho/HackerRankSolutions | 2d525ca9f13297cbee0191e2c14a04208cb97a69 | [
"BSD-3-Clause"
] | null | null | null | itertools-permutations.py | 0xecho/HackerRankSolutions | 2d525ca9f13297cbee0191e2c14a04208cb97a69 | [
"BSD-3-Clause"
] | null | null | null | # Enter your code here. Read input from STDIN. Print output to STDOUT
from itertools import permutations
a,b=input().split()
l=[]
for i in permutations(a,int(b)):
l.append("".join(i))
print(*sorted(l),sep="\n")
| 22.1 | 69 | 0.674208 | # Enter your code here. Read input from STDIN. Print output to STDOUT
from itertools import permutations
a,b=input().split()
l=[]
for i in permutations(a,int(b)):
l.append("".join(i))
print(*sorted(l),sep="\n")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b77fb1665802ba3e8e72ec46268880c63568c905 | 2,272 | py | Python | apps/DeepFaceLive/ui/widgets/QBCFinalFrameViewer.py | kitiv/DeepFaceLive | ca3a005917ae067576b795d8b9fef5a8b3483010 | [
"MIT"
] | 4 | 2021-07-23T16:34:24.000Z | 2022-03-01T18:31:59.000Z | apps/DeepFaceLive/ui/widgets/QBCFinalFrameViewer.py | kitiv/DeepFaceLive | ca3a005917ae067576b795d8b9fef5a8b3483010 | [
"MIT"
] | null | null | null | apps/DeepFaceLive/ui/widgets/QBCFinalFrameViewer.py | kitiv/DeepFaceLive | ca3a005917ae067576b795d8b9fef5a8b3483010 | [
"MIT"
] | 1 | 2021-09-06T15:05:28.000Z | 2021-09-06T15:05:28.000Z |
from ... import backend
| 37.245902 | 105 | 0.625 | from localization import L
from PyQt6.QtCore import *
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from resources.fonts import QXFontDB
from xlib import qt as lib_qt
from ... import backend
class QBCFinalFrameViewer(lib_qt.QXCollapsibleSection):
def __init__(self, backed_weak_heap : backend.BackendWe... | 0 | 0 | 0 | 2,046 | 0 | 0 | 0 | 45 | 155 |
a7aac7f5fb0381dec1b2dca3a584880cc31d52e6 | 8,728 | py | Python | examples/earm/fit_1_3_standalone.py | johnbachman/bayessb | 0c4c4d57218edea2786616077600f07ed821337e | [
"BSD-2-Clause"
] | 1 | 2015-04-02T21:04:39.000Z | 2015-04-02T21:04:39.000Z | examples/earm/fit_1_3_standalone.py | LoLab-VU/bayessb | 0a21da7383e78ab1d9666f4faa9a57893aa31397 | [
"BSD-2-Clause"
] | null | null | null | examples/earm/fit_1_3_standalone.py | LoLab-VU/bayessb | 0a21da7383e78ab1d9666f4faa9a57893aa31397 | [
"BSD-2-Clause"
] | null | null | null | # Fits EARM 1.3 (Gaudet et. al 2012) against a single-cell time course
# measurement of an executioner caspase reporter (a proxy for Caspase-3 activity
# i.e. PARP cleavage). The model is contained in earm_1_3_standalone.py which
# was produced via export from a PySB implementation of the model
# (pysb.examples.earm_1_... | 43.64 | 95 | 0.665445 | # Fits EARM 1.3 (Gaudet et. al 2012) against a single-cell time course
# measurement of an executioner caspase reporter (a proxy for Caspase-3 activity
# i.e. PARP cleavage). The model is contained in earm_1_3_standalone.py which
# was produced via export from a PySB implementation of the model
# (pysb.examples.earm_1_... | 0 | 0 | 0 | 0 | 0 | 4,059 | 0 | 0 | 23 |
0adb2badb77522872cd8922dc99a45d52f1af621 | 1,309 | py | Python | Chapter_BestPractices/Feature_Engineering_quadraticFit.py | ML-PSE/Machine_Learning_for_PSE | b53578d7cc0e0eca4907527b188a60de06d6710e | [
"Apache-2.0"
] | 2 | 2022-02-20T18:57:46.000Z | 2022-03-03T07:07:12.000Z | Chapter_BestPractices/Feature_Engineering_quadraticFit.py | ML-PSE/Machine_Learning_for_PSE | b53578d7cc0e0eca4907527b188a60de06d6710e | [
"Apache-2.0"
] | null | null | null | Chapter_BestPractices/Feature_Engineering_quadraticFit.py | ML-PSE/Machine_Learning_for_PSE | b53578d7cc0e0eca4907527b188a60de06d6710e | [
"Apache-2.0"
] | null | null | null | ##%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
## Feature Engineering (quadratic fit via linear model)
## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#%% read data
import numpy as np
data = np.loadtxt('quadratic_raw_data.csv', del... | 29.75 | 80 | 0.614973 | ##%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
## Feature Engineering (quadratic fit via linear model)
## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#%% read data
import numpy as np
data = np.loadtxt('quadratic_raw_data.csv', del... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5335324f77fcba245683531ccac4bdda0873097c | 6,691 | py | Python | pynucastro/rates/tests/test_rates.py | XinlongSBU/pynucastro | 4f1547e99208ad03d8f79d748601219591a157b5 | [
"BSD-3-Clause"
] | 18 | 2018-01-18T20:41:28.000Z | 2022-03-02T22:06:47.000Z | pynucastro/rates/tests/test_rates.py | XinlongSBU/pynucastro | 4f1547e99208ad03d8f79d748601219591a157b5 | [
"BSD-3-Clause"
] | 139 | 2018-01-18T21:29:18.000Z | 2022-03-30T15:24:05.000Z | pynucastro/rates/tests/test_rates.py | XinlongSBU/pynucastro | 4f1547e99208ad03d8f79d748601219591a157b5 | [
"BSD-3-Clause"
] | 22 | 2018-01-26T18:59:49.000Z | 2022-03-24T05:25:52.000Z | # unit tests for rates
import pynucastro.rates as rates
| 28.47234 | 71 | 0.578688 | # unit tests for rates
import math
import pynucastro.rates as rates
from pytest import approx
class TestTfactors(object):
@classmethod
def setup_class(cls):
""" this is run once for each class before any tests """
pass
@classmethod
def teardown_class(cls):
""" this is run onc... | 0 | 576 | 0 | 5,948 | 0 | 0 | 0 | -6 | 113 |
d60c05382f861663a676299f5ec32067e8b72145 | 6,483 | py | Python | library/vmanage_feature_template.py | johnwelby1965/viptela | fe19bd247fc0d797b9b1d87c77395dd5abfc5f35 | [
"BSD-Source-Code"
] | 28 | 2019-06-05T17:50:19.000Z | 2021-10-31T11:24:19.000Z | library/vmanage_feature_template.py | johnwelby1965/viptela | fe19bd247fc0d797b9b1d87c77395dd5abfc5f35 | [
"BSD-Source-Code"
] | 35 | 2019-06-05T19:06:09.000Z | 2022-03-22T00:45:51.000Z | library/vmanage_feature_template.py | johnwelby1965/viptela | fe19bd247fc0d797b9b1d87c77395dd5abfc5f35 | [
"BSD-Source-Code"
] | 20 | 2019-07-08T20:06:50.000Z | 2022-03-20T18:04:42.000Z | #!/usr/bin/env python
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
if __name__ == '__main__':
main()
| 48.380597 | 147 | 0.592318 | #!/usr/bin/env python
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
from ansible.module_utils.basic import AnsibleModule, json
from ansible.module_utils.viptela import viptelaModule, viptela_argument_spec
from collections import OrderedDict
def run_m... | 0 | 0 | 0 | 0 | 0 | 6,086 | 0 | 107 | 113 |
573f25db3883e8c8bb39b065f576bd1012808ed2 | 1,941 | py | Python | utils/arg_utils.py | syelman/DM-Count | 882f52478014ac68c154bff1f86668bddcb8adf4 | [
"MIT"
] | 3 | 2021-04-15T15:51:54.000Z | 2021-09-01T08:19:39.000Z | utils/arg_utils.py | SelmanOzleyen/DM-Count | 882f52478014ac68c154bff1f86668bddcb8adf4 | [
"MIT"
] | null | null | null | utils/arg_utils.py | SelmanOzleyen/DM-Count | 882f52478014ac68c154bff1f86668bddcb8adf4 | [
"MIT"
] | 1 | 2021-07-16T06:00:50.000Z | 2021-07-16T06:00:50.000Z | def assign_latest_cp(args):
"""
From the given arguments checks the 'out_path' parameters.
Looks for a checkpoint assuming the checkpoint was saved in out_path
and the previous run was with the same training parameters.
Example:
If you run the program with these arguments;
"data... | 41.297872 | 97 | 0.582174 | def assign_latest_cp(args):
"""
From the given arguments checks the 'out_path' parameters.
Looks for a checkpoint assuming the checkpoint was saved in out_path
and the previous run was with the same training parameters.
Example:
If you run the program with these arguments;
"data... | 0 | 0 | 0 | 0 | 0 | 208 | 0 | -1 | 26 |
b93f7c7deeb7c3a8b24356d19527891a4fe52f38 | 2,812 | py | Python | nasergame/components/wireframe.py | nfearnley/nasergame | ada3a6937b955e31d0da8bf5205b861f2c58b1a4 | [
"MIT"
] | null | null | null | nasergame/components/wireframe.py | nfearnley/nasergame | ada3a6937b955e31d0da8bf5205b861f2c58b1a4 | [
"MIT"
] | null | null | null | nasergame/components/wireframe.py | nfearnley/nasergame | ada3a6937b955e31d0da8bf5205b861f2c58b1a4 | [
"MIT"
] | null | null | null |
__all__ = ["Wireframe"]
def pairs(iterable):
"s -> (s0,s1), (s1,s2), (s2, s3), ..."
return zip(iterable[::2], iterable[1::2])
| 31.954545 | 90 | 0.589616 | import pygame
from digicolor import colors
import numpy as np
from nasergame.lib import math3d as m3d
__all__ = ["Wireframe"]
def pairs(iterable):
"s -> (s0,s1), (s1,s2), (s2, s3), ..."
return zip(iterable[::2], iterable[1::2])
def clip(line_nodes):
clipped_nodes = []
for n, f in pairs(line_nodes)... | 0 | 0 | 0 | 1,891 | 0 | 633 | 0 | 14 | 135 |
f0f1716ac5b1a7a3f286113d26fa0f48532ae85a | 121 | py | Python | main.py | Monte95-boss/machine-learning-fav | 774bfb418f1754880ef17105ff1e4936be751ca9 | [
"MIT"
] | null | null | null | main.py | Monte95-boss/machine-learning-fav | 774bfb418f1754880ef17105ff1e4936be751ca9 | [
"MIT"
] | null | null | null | main.py | Monte95-boss/machine-learning-fav | 774bfb418f1754880ef17105ff1e4936be751ca9 | [
"MIT"
] | null | null | null | import numpy as np
a = np.array([[3,2,1], [5, 4, -1]])
b = np.array([[4,5,7], [-3, 4, -1]])
print(a*b)
print(a)
print(b) | 17.285714 | 36 | 0.512397 | import numpy as np
a = np.array([[3,2,1], [5, 4, -1]])
b = np.array([[4,5,7], [-3, 4, -1]])
print(a*b)
print(a)
print(b) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
107e55b899b89d8acc23697da4848cbd4fc45f8c | 8,289 | py | Python | restae/serializers.py | tolsac/gae-rest-framework | 0ac2a99f14f8204bf546b3aafd37ba953a247fe3 | [
"MIT"
] | 2 | 2018-08-01T13:14:08.000Z | 2019-04-22T18:53:52.000Z | restae/serializers.py | tolsac/restae | 0ac2a99f14f8204bf546b3aafd37ba953a247fe3 | [
"MIT"
] | null | null | null | restae/serializers.py | tolsac/restae | 0ac2a99f14f8204bf546b3aafd37ba953a247fe3 | [
"MIT"
] | null | null | null | """
Serializers
"""
TYPE_MAPPING = {
'IntegerProperty': IntegerField,
'FloatProperty': FloatField,
'BooleanProperty': BooleanField,
'StringProperty': StringField,
'TextProperty': StringField,
'DateTimeProperty': DatetimeField,
'KeyProperty': KeyField
}
READ_ONLY_FIELDS = [
M... | 29.18662 | 120 | 0.556159 | """
Serializers
"""
import datetime
import collections
from dateutil import parser
from google.appengine.ext.ndb import ModelAttribute
from exceptions import ValidationError, SerializerError
from helpers import get_key_from_urlsafe, KEY_CLASS
def get_attribute(obj, name):
if issubclass(obj.__class__, collection... | 0 | 204 | 0 | 6,752 | 0 | 496 | 0 | 91 | 410 |
7eebfb5d7d84231a8be77e5500d77bbfc5d53a13 | 2,379 | py | Python | backend/app/tests/api/node_comment/test_delete.py | hollyfoxx/ace2-gui | e0f72cafdd524e0cd66549a9315697aa21ae46fa | [
"Apache-2.0"
] | 1 | 2021-07-16T10:34:22.000Z | 2021-07-16T10:34:22.000Z | backend/app/tests/api/node_comment/test_delete.py | hollyfoxx/ace2-gui | e0f72cafdd524e0cd66549a9315697aa21ae46fa | [
"Apache-2.0"
] | null | null | null | backend/app/tests/api/node_comment/test_delete.py | hollyfoxx/ace2-gui | e0f72cafdd524e0cd66549a9315697aa21ae46fa | [
"Apache-2.0"
] | null | null | null |
"""
NOTE: There are no tests for the foreign key constraints. The DELETE endpoint will need to be updated once the endpoints
are in place in order to account for this.
"""
#
# INVALID TESTS
#
#
# VALID TESTS
#
| 27.988235 | 120 | 0.663304 | import uuid
from fastapi import status
"""
NOTE: There are no tests for the foreign key constraints. The DELETE endpoint will need to be updated once the endpoints
are in place in order to account for this.
"""
#
# INVALID TESTS
#
def test_delete_invalid_uuid(client):
delete = client.delete("/api/node/commen... | 0 | 0 | 0 | 0 | 0 | 2,051 | 0 | -5 | 114 |
54be1ff0cd24684377ef2c06429310cd67edb973 | 1,994 | py | Python | assets/ur_assemble/track_data/plot_3d.py | akux2021/Isaac-drlgrasp | 89c14e98462fd2ef7cac78be1f0e8e7a74d02417 | [
"Apache-2.0"
] | null | null | null | assets/ur_assemble/track_data/plot_3d.py | akux2021/Isaac-drlgrasp | 89c14e98462fd2ef7cac78be1f0e8e7a74d02417 | [
"Apache-2.0"
] | null | null | null | assets/ur_assemble/track_data/plot_3d.py | akux2021/Isaac-drlgrasp | 89c14e98462fd2ef7cac78be1f0e8e7a74d02417 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import matplotlib.pyplot as plt
x,y,z = [], [], []
xd,yd,zd = [], [], []
x_fname = '/home/cobot/Desktop/assemble_project/track_data/assemble_0.01s/dataFile_x.txt'
x_dmp_fname = '/home/cobot/Desktop/assemble_project/track_data/assemble_0.01s/dmp_dataFile_x.txt'
with open(x_fname, 'r') as fx:#1
... | 32.688525 | 97 | 0.672016 | #!/usr/bin/env python
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
x,y,z = [], [], []
xd,yd,zd = [], [], []
x_fname = '/home/cobot/Desktop/assemble_project/track_data/assemble_0.01s/dataFile_x.txt'
x_dmp_fname = '/home/cobot/Desktop/assemble_project/track_data/assemble_0.01s/dmp_dataFi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 45 |
a3504b1078fd64c3d2cb51f1f20e98fe4832217c | 1,122 | py | Python | app.py | MarkCDavid/vgtu-gcal | 78779d6bad02668a91fa0af7a6b372f45051e449 | [
"MIT"
] | null | null | null | app.py | MarkCDavid/vgtu-gcal | 78779d6bad02668a91fa0af7a6b372f45051e449 | [
"MIT"
] | 2 | 2021-03-31T19:36:48.000Z | 2021-12-13T20:31:34.000Z | app.py | MarkCDavid/vgtu-gcal | 78779d6bad02668a91fa0af7a6b372f45051e449 | [
"MIT"
] | null | null | null | #!python
if __name__ == "__main__":
convert(*build_options())
| 34 | 116 | 0.688948 | #!python
from timetable.timetableparser import parse
import sys
import export
import argparse
def change_extension(filename, new_extension):
return f"{'.'.join(filename.split('.')[:-1])}.{new_extension}"
def build_options():
parser = argparse.ArgumentParser()
parser.add_argument('input', default=sys.st... | 0 | 0 | 0 | 0 | 0 | 896 | 0 | -3 | 158 |
cebf6de8dd14ae58b957f54f469884594aefea16 | 1,544 | py | Python | part-01.py | marvinlemos/introduction-to-ann | a83e720c4bbbe48367882a02a2cd191cabc35067 | [
"MIT"
] | null | null | null | part-01.py | marvinlemos/introduction-to-ann | a83e720c4bbbe48367882a02a2cd191cabc35067 | [
"MIT"
] | null | null | null | part-01.py | marvinlemos/introduction-to-ann | a83e720c4bbbe48367882a02a2cd191cabc35067 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 29 09:22:06 2018
@author: marvin
"""
import numpy as np
## 1. Data dimensions
### 2. Scalars: 0-dimension
height = np.array(1.79)
age = np.array(1.79, dtype=np.uint8) ##unsigned int
# age2 becomes int64
age2 = age + 3
age2 = age + np.array(3, d... | 19.544304 | 88 | 0.638601 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 29 09:22:06 2018
@author: marvin
"""
import numpy as np
## 1. Data dimensions
### 2. Scalars: 0-dimension
height = np.array(1.79)
age = np.array(1.79, dtype=np.uint8) ##unsigned int
# age2 becomes int64
age2 = age + 3
age2 = age + np.array(3, d... | 0 | 0 | 0 | 0 | 0 | 21 | 0 | 0 | 23 |
dd9d46d47e4254d726bfbb521a4f94826b275c11 | 850 | py | Python | py/scrap_heroes/test/test_utils.py | BenjaminCbr/cinoisp-storm | 94151e8f741fba8a24bd3e5fdea41d79b39bc47d | [
"Apache-2.0"
] | null | null | null | py/scrap_heroes/test/test_utils.py | BenjaminCbr/cinoisp-storm | 94151e8f741fba8a24bd3e5fdea41d79b39bc47d | [
"Apache-2.0"
] | null | null | null | py/scrap_heroes/test/test_utils.py | BenjaminCbr/cinoisp-storm | 94151e8f741fba8a24bd3e5fdea41d79b39bc47d | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
| 22.972973 | 67 | 0.482353 | from __future__ import unicode_literals
from django.test import TestCase
from ..utils import partial_dict_equals
class DictUtilsTest(TestCase):
def test_partial_dict_equals__regular_case(self):
small_dict = {
"a": 1,
"b": [2, 3, 6],
"d": False
}
big_d... | 0 | 0 | 0 | 711 | 0 | 0 | 0 | 29 | 69 |
026b04032254c56bb331f8147d5e5f5949c14d44 | 2,731 | py | Python | tests/acceptance/commons/constants.py | telefonicaid/fiware-glancesync | 5ad0c80e12b9384473f31bf336015c75cf02a2a2 | [
"Apache-2.0"
] | null | null | null | tests/acceptance/commons/constants.py | telefonicaid/fiware-glancesync | 5ad0c80e12b9384473f31bf336015c75cf02a2a2 | [
"Apache-2.0"
] | 88 | 2015-07-21T22:13:23.000Z | 2016-11-15T21:28:56.000Z | tests/acceptance/commons/constants.py | telefonicaid/fiware-glancesync | 5ad0c80e12b9384473f31bf336015c75cf02a2a2 | [
"Apache-2.0"
] | 2 | 2015-08-12T11:19:55.000Z | 2018-05-25T19:04:43.000Z | # -*- coding: utf-8 -*-
# Copyright 2015-2016 Telefnica Investigacin y Desarrollo, S.A.U
#
# This file is part of FIWARE project.
#
# 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:... | 34.56962 | 75 | 0.819114 | # -*- coding: utf-8 -*-
# Copyright 2015-2016 Telefónica Investigación y Desarrollo, S.A.U
#
# This file is part of FIWARE project.
#
# 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:
#
# htt... | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e049b825a1420443cd374a64329ca251929cbd2e | 4,327 | py | Python | strong_graphs/generator.py | stevedwards/strong-graphs | b509dc68fa4ce5c07664ba84e5f8dbf1888d4f8e | [
"MIT"
] | 1 | 2020-07-16T03:26:07.000Z | 2020-07-16T03:26:07.000Z | strong_graphs/generator.py | stevedwards/strong-graphs | b509dc68fa4ce5c07664ba84e5f8dbf1888d4f8e | [
"MIT"
] | 10 | 2020-07-15T06:07:59.000Z | 2020-07-17T01:02:59.000Z | strong_graphs/generator.py | stevedwards/strong-graphs | b509dc68fa4ce5c07664ba84e5f8dbf1888d4f8e | [
"MIT"
] | 1 | 2020-07-16T05:38:38.000Z | 2020-07-16T05:38:38.000Z | import itertools
import math
import random
from functools import partial
from strong_graphs.output import output
from strong_graphs.data_structure import Network
from strong_graphs.negative import (nb_neg_arcs, nb_neg_loop_arcs, nb_neg_tree_arcs)
from strong_graphs.arc_generators import (gen_tree_arcs, gen_remaining_ar... | 30.687943 | 97 | 0.619598 | import itertools
import math
import random
from functools import partial
from strong_graphs.output import output
from strong_graphs.data_structure import Network
from strong_graphs.negative import (
nb_neg_arcs,
nb_neg_loop_arcs,
nb_neg_tree_arcs,
)
from strong_graphs.arc_generators import (
gen_tree_ar... | 62 | 0 | 0 | 0 | 0 | 618 | 0 | 56 | 93 |
ad66a61feb5dd0bbb57eec219098dc11a8b913b2 | 3,350 | py | Python | src/ch_spring_2021/resources/starter.py | GuillaumeEscande/gaming-tools | 2803d32fcefec90d28e43f9efd32ab1338de78f6 | [
"MIT"
] | null | null | null | src/ch_spring_2021/resources/starter.py | GuillaumeEscande/gaming-tools | 2803d32fcefec90d28e43f9efd32ab1338de78f6 | [
"MIT"
] | null | null | null | src/ch_spring_2021/resources/starter.py | GuillaumeEscande/gaming-tools | 2803d32fcefec90d28e43f9efd32ab1338de78f6 | [
"MIT"
] | null | null | null |
number_of_cells = int(input())
game = Game()
for i in range(number_of_cells):
cell_index, richness, neigh_0, neigh_1, neigh_2, neigh_3, neigh_4, neigh_5 = [int(j) for j in input().split()]
game.board.append(Cell(cell_index, richness, [neigh_0, neigh_1, neigh_2, neigh_3, neigh_4, neigh_5]))
while True... | 32.843137 | 115 | 0.617015 | import sys
import math
from enum import Enum
import random
class Cell:
def __init__(self, cell_index, richness, neighbors):
self.cell_index = cell_index
self.richness = richness
self.neighbors = neighbors
class Tree:
def __init__(self, cell_index, size, is_mine, is_dormant)... | 0 | 493 | 0 | 1,316 | 0 | 0 | 0 | -29 | 216 |
5d7374a99e35b6523ff1674b87b2261410c343a3 | 1,629 | py | Python | finance/csvapi.py | nuwainfo/treeio | f57bf9114d9774c11468a1b0e44614b04631beb1 | [
"MIT"
] | null | null | null | finance/csvapi.py | nuwainfo/treeio | f57bf9114d9774c11468a1b0e44614b04631beb1 | [
"MIT"
] | null | null | null | finance/csvapi.py | nuwainfo/treeio | f57bf9114d9774c11468a1b0e44614b04631beb1 | [
"MIT"
] | null | null | null | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Import/Export Contacts API
"""
| 29.618182 | 115 | 0.647023 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Import/Export Contacts API
"""
import csv
from django.http import HttpResponse
import StringIO
import datetime
class ProcessTransactions():
"Import/Export Contacts"
def export_transactions(s... | 0 | 0 | 0 | 1,376 | 0 | 0 | 0 | -8 | 112 |
5847eb5c1a96636c15cd01dc8655e2afc973801e | 21,131 | py | Python | polymuse/rnn.py | rushike/polymuse-future | 25af861e11fc3f4f95327405fec15d48bcc84a62 | [
"MIT"
] | 1 | 2019-11-30T11:12:08.000Z | 2019-11-30T11:12:08.000Z | polymuse/rnn.py | rushike/polymuse-future | 25af861e11fc3f4f95327405fec15d48bcc84a62 | [
"MIT"
] | null | null | null | polymuse/rnn.py | rushike/polymuse-future | 25af861e11fc3f4f95327405fec15d48bcc84a62 | [
"MIT"
] | null | null | null |
"""
Model building using keras library
This includes code for building the various RNN base models for our polymuse
The models are store in current directory, in hierarchy
--h5_models/
--piano/
--stateful/
--stateless/
--lead/
--stateful/
--stateless/
--drum/
-... | 33.863782 | 198 | 0.613033 |
"""
Model building using keras library
This includes code for building the various RNN base models for our polymuse
The models are store in current directory, in hierarchy
--h5_models/
--piano/
--stateful/
--stateless/
--lead/
--stateful/
--stateless/
--drum/
-... | 0 | 0 | 0 | 0 | 0 | 19,514 | 0 | 231 | 504 |
76ee50cc5236f28b4d55f384e4043818c65bd291 | 5,430 | py | Python | configs/topologies/Cluster.py | caihuayi/gem5 | 96fce476785a834f102ae69a895e661cf08e47cd | [
"BSD-3-Clause"
] | 16 | 2020-09-24T00:17:36.000Z | 2021-08-12T06:11:52.000Z | configs/topologies/Cluster.py | caihuayi/gem5 | 96fce476785a834f102ae69a895e661cf08e47cd | [
"BSD-3-Clause"
] | 5 | 2021-01-27T23:09:06.000Z | 2022-01-07T03:19:39.000Z | configs/topologies/Cluster.py | caihuayi/gem5 | 96fce476785a834f102ae69a895e661cf08e47cd | [
"BSD-3-Clause"
] | 15 | 2020-11-18T00:15:28.000Z | 2021-12-12T03:18:34.000Z | # Copyright (c) 2012 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions... | 41.769231 | 86 | 0.643462 | # Copyright (c) 2012 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions... | 0 | 261 | 0 | 3,484 | 0 | 0 | 0 | 27 | 46 |
a68cd80b8eef2cd943c057ee27259bdc326f57e0 | 501 | py | Python | setup.py | stevedpedersen/spotify-enthusiast | 91d40ae94a892be8db51d48d624b1a3849e30001 | [
"MIT"
] | 3 | 2017-12-14T07:37:12.000Z | 2019-10-11T16:34:18.000Z | setup.py | stevedpedersen/spotify-enthusiast | 91d40ae94a892be8db51d48d624b1a3849e30001 | [
"MIT"
] | 19 | 2017-11-09T19:18:08.000Z | 2017-12-09T00:33:56.000Z | setup.py | stevedpedersen/spotify-enthusiast | 91d40ae94a892be8db51d48d624b1a3849e30001 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='spotify_infosuite',
version='0.1.0',
description='Provides info about song/artist',
long_description=readme,
url='https://github.com/stevedpedersen/spotify-inf... | 25.05 | 59 | 0.738523 | from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='spotify_infosuite',
version='0.1.0',
description='Provides info about song/artist',
long_description=readme,
url='https://github.com/stevedpedersen/spotify-inf... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ee1dfa06d170c3f3af2ca0895ade8f214a1cd226 | 2,313 | py | Python | src/antidote/_implementation.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null | src/antidote/_implementation.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null | src/antidote/_implementation.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null | from typing import TypeVar
from typing_extensions import ParamSpec
P = ParamSpec("P")
T = TypeVar("T")
# @API.private
| 36.140625 | 93 | 0.712062 | import functools
import warnings
from typing import Callable, Generic, Hashable, Type, TypeVar
from typing_extensions import ParamSpec
from ._internal import API
from ._providers.indirect import ImplementationDependency
P = ParamSpec("P")
T = TypeVar("T")
# @API.private
class ImplementationWrapper(Generic[P, T]):
... | 0 | 697 | 0 | 1,294 | 0 | 0 | 0 | 65 | 134 |
6efa9f3eeb3239f285419298b4ea464cc1b89696 | 631 | py | Python | bluebottle/categories/migrations/0012_category_video.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 10 | 2015-05-28T18:26:40.000Z | 2021-09-06T10:07:03.000Z | bluebottle/categories/migrations/0012_category_video.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 762 | 2015-01-15T10:00:59.000Z | 2022-03-31T15:35:14.000Z | bluebottle/categories/migrations/0012_category_video.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 9 | 2015-02-20T13:19:30.000Z | 2022-03-08T14:09:17.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2020-09-04 08:33
from __future__ import unicode_literals
| 28.681818 | 192 | 0.679873 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2020-09-04 08:33
from __future__ import unicode_literals
import bluebottle.files.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('categories', '0011_auto_20200422_0821'),
]
oper... | 0 | 0 | 0 | 416 | 0 | 0 | 0 | 32 | 68 |
613d0a5524d6c8f8a0c28b26487b0c9a61e4ee9e | 1,979 | py | Python | configuration.py | nichwall/LASA-Engineering-Design-Quizzes | ff86e51537efae1614601af576bac56ddb816cc4 | [
"MIT"
] | null | null | null | configuration.py | nichwall/LASA-Engineering-Design-Quizzes | ff86e51537efae1614601af576bac56ddb816cc4 | [
"MIT"
] | null | null | null | configuration.py | nichwall/LASA-Engineering-Design-Quizzes | ff86e51537efae1614601af576bac56ddb816cc4 | [
"MIT"
] | null | null | null | # Uses Python 2.7
print "This program will allow you to easily edit the quiz data."
print "It assumes that a folder named 'Website' is in the same directory\n and that the folder structure matches that of the"
print "one located at https://github.com/nichwall/LASA-Engineering-Design-Quizzes."
print "\nThe quiz data is... | 24.134146 | 125 | 0.654876 | # Uses Python 2.7
print "This program will allow you to easily edit the quiz data."
print "It assumes that a folder named 'Website' is in the same directory\n and that the folder structure matches that of the"
print "one located at https://github.com/nichwall/LASA-Engineering-Design-Quizzes."
print "\nThe quiz data is... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6403fdbba154094702965a8c72c882a911f8af11 | 3,893 | py | Python | misago/misago/users/tests/test_profilefields.py | vascoalramos/misago-deployment | 20226072138403108046c0afad9d99eb4163cedc | [
"MIT"
] | 2 | 2021-03-06T21:06:13.000Z | 2021-03-09T15:05:12.000Z | misago/misago/users/tests/test_profilefields.py | vascoalramos/misago-deployment | 20226072138403108046c0afad9d99eb4163cedc | [
"MIT"
] | null | null | null | misago/misago/users/tests/test_profilefields.py | vascoalramos/misago-deployment | 20226072138403108046c0afad9d99eb4163cedc | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
User = get_user_model()
| 30.653543 | 91 | 0.529155 | from django.contrib.auth import get_user_model
from django.test import TestCase
from ..profilefields import ProfileFields
User = get_user_model()
class ProfileFieldsLoadTests(TestCase):
def test_no_groups(self):
"""profile fields util handles empty list"""
profilefields = ProfileFields([])
... | 0 | 0 | 0 | 3,721 | 0 | 0 | 0 | 31 | 68 |
6fa1263674a791a83fe2fc36b1219428637220f6 | 1,330 | py | Python | leetcode/445. Add Two Numbers II/soln.py | saisankargochhayat/algo_quest | a24f9a22c019ab31d56bd5a7ca5ba790d54ce5dc | [
"Apache-2.0"
] | 3 | 2017-02-15T20:55:04.000Z | 2018-09-26T18:48:24.000Z | leetcode/445. Add Two Numbers II/soln.py | saisankargochhayat/algo_quest | a24f9a22c019ab31d56bd5a7ca5ba790d54ce5dc | [
"Apache-2.0"
] | 4 | 2017-10-07T18:59:20.000Z | 2019-10-08T05:43:25.000Z | leetcode/445. Add Two Numbers II/soln.py | saisankargochhayat/algo_quest | a24f9a22c019ab31d56bd5a7ca5ba790d54ce5dc | [
"Apache-2.0"
] | 1 | 2017-10-08T06:52:21.000Z | 2017-10-08T06:52:21.000Z | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
| 31.666667 | 68 | 0.502256 | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
l1 = self.reverse(l1)
l2 = self.reverse(l2)
result = None
... | 0 | 0 | 0 | 1,157 | 0 | 0 | 0 | 0 | 22 |
c7839be81eed502f913e07a7ef665a971a8aec9c | 2,093 | py | Python | examples/bSplineExample.py | bddonovan/PyXFocus | 2d6722f0db28c045df35075487f9d4fdfed8b284 | [
"MIT"
] | 1 | 2018-04-20T15:32:24.000Z | 2018-04-20T15:32:24.000Z | examples/bSplineExample.py | bddonovan/PyXFocus | 2d6722f0db28c045df35075487f9d4fdfed8b284 | [
"MIT"
] | 6 | 2017-11-03T16:13:46.000Z | 2019-04-26T11:13:03.000Z | examples/bSplineExample.py | bddonovan/PyXFocus | 2d6722f0db28c045df35075487f9d4fdfed8b284 | [
"MIT"
] | 4 | 2017-04-13T17:24:54.000Z | 2019-08-08T15:27:29.000Z | #-----------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------
#-------------------------------B-SPLINE EXAMPLE CODE-------------------------------
#----------------------------------------------------------------... | 38.054545 | 84 | 0.494983 | #-----------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------
#-------------------------------B-SPLINE EXAMPLE CODE-------------------------------
#----------------------------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 23 |
d7cc682576d493869c8cc0046039e08f8eee85b5 | 1,811 | py | Python | spider/common/get_user_agent.py | mofei77/hkjc | 91e9ea31a5d84b0d2fe7ca27813cb31b9f82290e | [
"MIT"
] | 2 | 2020-01-12T15:51:19.000Z | 2020-02-01T04:10:39.000Z | spider/common/get_user_agent.py | mofei77/hkjc | 91e9ea31a5d84b0d2fe7ca27813cb31b9f82290e | [
"MIT"
] | null | null | null | spider/common/get_user_agent.py | mofei77/hkjc | 91e9ea31a5d84b0d2fe7ca27813cb31b9f82290e | [
"MIT"
] | null | null | null |
HEADERS = {
'Host': 'bet.hkjc.com',
'User-Agent': getheaders(),
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
'Accept-Encoding': 'gzip, deflate, br',
'... | 67.074074 | 140 | 0.59249 | import random
def getheaders():
user_agent_list = ['Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1464.0 Safari/537.36',
'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.16 Safari/537.36',
'Mozil... | 0 | 0 | 0 | 0 | 0 | 1,373 | 0 | -8 | 46 |
d5f236c3098d67643d3e291020f49b83a4e2f82c | 8,117 | py | Python | pyrasta/tools/conversion.py | benjaminpillot/pyrasta | 660564923f9e3a27974be968303d0dec95fb27e9 | [
"MIT"
] | null | null | null | pyrasta/tools/conversion.py | benjaminpillot/pyrasta | 660564923f9e3a27974be968303d0dec95fb27e9 | [
"MIT"
] | null | null | null | pyrasta/tools/conversion.py | benjaminpillot/pyrasta | 660564923f9e3a27974be968303d0dec95fb27e9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Module summary description.
More detailed description.
"""
from pyrasta.io_.files import RasterTempFile, VrtTempFile
from pyrasta.tools import _gdal_temp_dataset
from osgeo import gdal_array
import affine
import gdal
def _array_to_raster(raster_class, array, crs, bounds,
... | 31.219231 | 96 | 0.557965 | # -*- coding: utf-8 -*-
""" Module summary description.
More detailed description.
"""
from pyrasta.crs import srs_from
from pyrasta.io_.files import RasterTempFile, VrtTempFile
from pyrasta.tools import _gdal_temp_dataset, _return_raster
from osgeo import gdal_array
import affine
import gdal
@_return_raster
def ... | 0 | 3,656 | 0 | 0 | 0 | 0 | 0 | 27 | 160 |
953d6c6671c84ba627b935dbbff495979027a3e1 | 7,192 | py | Python | dog.py | Lock-n/Process-Memory-Monitor | f91863923c02f44b16fe1f8398c4088971b53fa6 | [
"MIT"
] | null | null | null | dog.py | Lock-n/Process-Memory-Monitor | f91863923c02f44b16fe1f8398c4088971b53fa6 | [
"MIT"
] | null | null | null | dog.py | Lock-n/Process-Memory-Monitor | f91863923c02f44b16fe1f8398c4088971b53fa6 | [
"MIT"
] | null | null | null | import sys, imp;
# Check if psutil is installed
try:
f, pathname, desc = imp.find_module("psutil", sys.path[1:])
except ImportError:
print("Install psutil with \"pip install --user psutil\"")
sys.exit(0)
mm = MemoryMonitor()
mm.monitor() | 38.666667 | 157 | 0.50431 | import sys, imp;
# Check if psutil is installed
try:
f, pathname, desc = imp.find_module("psutil", sys.path[1:])
except ImportError:
print("Install psutil with \"pip install --user psutil\"")
sys.exit(0)
import psutil, time, threading, ctypes # An included library with Python install.
class MemoryMonito... | 0 | 1,620 | 0 | 5,206 | 0 | 0 | 0 | 17 | 90 |
62b7fc6c97343397723c99b3d06d614c0f04e41d | 155 | py | Python | DMOJ/CCC/2019/S1-Flipper.py | devAdhiraj/Competitive-Programming | 90116dd9532dcdf3947d1874910c8c797afe949e | [
"MIT"
] | null | null | null | DMOJ/CCC/2019/S1-Flipper.py | devAdhiraj/Competitive-Programming | 90116dd9532dcdf3947d1874910c8c797afe949e | [
"MIT"
] | null | null | null | DMOJ/CCC/2019/S1-Flipper.py | devAdhiraj/Competitive-Programming | 90116dd9532dcdf3947d1874910c8c797afe949e | [
"MIT"
] | null | null | null | a,b,c,d = 1,2,3,4
f= input()
if(f.count("V")%2 != 0):
a, b, c, d = b, a, d, c
if(f.count("H")%2 != 0):
a, b, c, d = c, d, a, b
print(a,b)
print(c,d)
| 14.090909 | 25 | 0.425806 | a,b,c,d = 1,2,3,4
f= input()
if(f.count("V")%2 != 0):
a, b, c, d = b, a, d, c
if(f.count("H")%2 != 0):
a, b, c, d = c, d, a, b
print(a,b)
print(c,d)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b34e98e9d9b09654e3045c4aa07bc11e3b524ab6 | 29,251 | py | Python | src/esdl_config.py | XIThing/esdl-mapeditor | 9f4cd4a58714ea67aeb532e88e88f0435a87dbd5 | [
"Apache-2.0"
] | null | null | null | src/esdl_config.py | XIThing/esdl-mapeditor | 9f4cd4a58714ea67aeb532e88e88f0435a87dbd5 | [
"Apache-2.0"
] | 14 | 2020-09-30T21:16:46.000Z | 2021-11-08T18:54:34.000Z | src/esdl_config.py | XIThing/esdl-mapeditor | 9f4cd4a58714ea67aeb532e88e88f0435a87dbd5 | [
"Apache-2.0"
] | 1 | 2020-09-17T12:48:57.000Z | 2020-09-17T12:48:57.000Z | # This work is based on original code developed and copyrighted by TNO 2020.
# Subsequent contributions are licensed to you by the developers of such code and are
# made available to the Project under one or several contributor license agreements.
#
# This work is licensed to you under the Apache License, Version 2... | 44.052711 | 199 | 0.358689 | # This work is based on original code developed and copyrighted by TNO 2020.
# Subsequent contributions are licensed to you by the developers of such code and are
# made available to the Project under one or several contributor license agreements.
#
# This work is licensed to you under the Apache License, Version 2... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
db64a408e9d8673a66f61ce0ec856f4bf266b97a | 8,376 | py | Python | pype/hosts/standalonepublisher/plugins/publish/extract_bg_for_compositing.py | simonebarbieri/pype | a6dc83aa1300738749cbe8e5e2e6d2d1794e0289 | [
"MIT"
] | null | null | null | pype/hosts/standalonepublisher/plugins/publish/extract_bg_for_compositing.py | simonebarbieri/pype | a6dc83aa1300738749cbe8e5e2e6d2d1794e0289 | [
"MIT"
] | null | null | null | pype/hosts/standalonepublisher/plugins/publish/extract_bg_for_compositing.py | simonebarbieri/pype | a6dc83aa1300738749cbe8e5e2e6d2d1794e0289 | [
"MIT"
] | null | null | null |
PSDImage = None
| 34.469136 | 80 | 0.553128 | import os
import json
import copy
import pype.api
from avalon import io
PSDImage = None
class ExtractBGForComp(pype.api.Extractor):
label = "Extract Background for Compositing"
families = ["backgroundComp"]
hosts = ["standalonepublisher"]
new_instance_family = "background"
# Presetable
allo... | 0 | 0 | 0 | 8,263 | 0 | 0 | 0 | -38 | 133 |
373a3e240bfb4752f5d712379de07b526a9194de | 24 | py | Python | lib_apk_shrink/utils/__init__.py | wtttc/apkshrink | 50b61c38b64c4a4fe0b11e686045852a3c685f3d | [
"MIT"
] | 3 | 2015-09-01T10:46:15.000Z | 2016-05-20T09:29:42.000Z | lib_apk_shrink/utils/__init__.py | wtttc/apkshrink | 50b61c38b64c4a4fe0b11e686045852a3c685f3d | [
"MIT"
] | null | null | null | lib_apk_shrink/utils/__init__.py | wtttc/apkshrink | 50b61c38b64c4a4fe0b11e686045852a3c685f3d | [
"MIT"
] | 1 | 2020-12-08T10:37:32.000Z | 2020-12-08T10:37:32.000Z | __author__ = 'tiantong'
| 12 | 23 | 0.75 | __author__ = 'tiantong'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
116769d3ee79c02a08e9d5b09fd78ce244697cca | 1,965 | py | Python | pymdwizard/gui/ui_files/UI_procstep.py | ennsk/fort-pymdwizard | 74a16d5333cd599537af1e55448327e3cfcced5a | [
"CC-BY-4.0"
] | null | null | null | pymdwizard/gui/ui_files/UI_procstep.py | ennsk/fort-pymdwizard | 74a16d5333cd599537af1e55448327e3cfcced5a | [
"CC-BY-4.0"
] | null | null | null | pymdwizard/gui/ui_files/UI_procstep.py | ennsk/fort-pymdwizard | 74a16d5333cd599537af1e55448327e3cfcced5a | [
"CC-BY-4.0"
] | 2 | 2017-03-16T21:18:11.000Z | 2019-06-03T14:25:16.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'procstep.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtWidgets
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Form = ... | 37.075472 | 75 | 0.701781 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'procstep.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Fo... | 0 | 0 | 0 | 1,504 | 0 | 0 | 0 | 15 | 23 |
f47b7a6204c6f27d73848955832ee132b142776e | 27,991 | py | Python | numba/testing/main.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 3 | 2017-08-11T13:05:44.000Z | 2021-08-10T07:47:13.000Z | numba/testing/main.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | numba/testing/main.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2021-01-31T18:58:54.000Z | 2021-01-31T18:58:54.000Z | import inspect
import os
import random
import unittest
try:
from multiprocessing import TimeoutError
except ImportError:
def make_tag_decorator(known_tags):
"""
Create a decorator allowing tests to be tagged with the *known_tags*.
"""
def tag(*tags):
"""
Tag a test method with th... | 35.839949 | 87 | 0.587689 | import collections
import contextlib
import cProfile
import inspect
import gc
import multiprocessing
import os
import random
import sys
import time
import unittest
import warnings
from io import StringIO
from unittest import result, runner, signals, suite, loader, case
from .loader import TestLoader
from numba.core i... | 0 | 413 | 0 | 18,952 | 0 | 2,329 | 0 | 30 | 721 |
7f3bdeddbba8f9e8b57f1b422291f6ae8a810f6f | 3,358 | py | Python | multidimensional-scaling/example.py | mgreiff/NUMA25 | 8fd65322852f6035e44f700c46f80a04c0ca4eec | [
"MIT"
] | null | null | null | multidimensional-scaling/example.py | mgreiff/NUMA25 | 8fd65322852f6035e44f700c46f80a04c0ca4eec | [
"MIT"
] | null | null | null | multidimensional-scaling/example.py | mgreiff/NUMA25 | 8fd65322852f6035e44f700c46f80a04c0ca4eec | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This example demonstrates how solutions to the TOA calibration
problem may be found using multi-dimensional scaling. The example
sets 10 anchors in space and the recreates their position based
on their mutual distances and a set of constraints
"""
import matplotlib.pylab as plt
import numpy ... | 34.265306 | 93 | 0.509529 | # -*- coding: utf-8 -*-
"""
This example demonstrates how solutions to the TOA calibration
problem may be found using multi-dimensional scaling. The example
sets 10 anchors in space and the recreates their position based
on their mutual distances and a set of constraints
"""
import matplotlib.pylab as plt
import numpy ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
beea55d4ba13ad117397eb9d147ff3333b0b0f9a | 1,875 | py | Python | nova/objects/external_event.py | mmnelemane/nova_stable_juno | e049553c7312480080091ad2481dcaf49113d571 | [
"Apache-2.0"
] | null | null | null | nova/objects/external_event.py | mmnelemane/nova_stable_juno | e049553c7312480080091ad2481dcaf49113d571 | [
"Apache-2.0"
] | 1 | 2021-03-21T11:39:52.000Z | 2021-03-21T11:39:52.000Z | nova/objects/external_event.py | mmnelemane/nova_stable_juno | e049553c7312480080091ad2481dcaf49113d571 | [
"Apache-2.0"
] | 1 | 2021-03-21T11:37:33.000Z | 2021-03-21T11:37:33.000Z | # Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 31.779661 | 78 | 0.671467 | # Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 0 | 825 | 0 | 0 | 0 | 0 | 0 | 30 | 67 |
3e0a0b05282e785a2f07e9fbc662957865b2cde6 | 149 | py | Python | examples/record.py | UsaDike/irrp_with_class | 312537b466f91ba4eaf6f5ac96b7fd438409b095 | [
"Unlicense"
] | null | null | null | examples/record.py | UsaDike/irrp_with_class | 312537b466f91ba4eaf6f5ac96b7fd438409b095 | [
"Unlicense"
] | null | null | null | examples/record.py | UsaDike/irrp_with_class | 312537b466f91ba4eaf6f5ac96b7fd438409b095 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
from irrp_with_class import IRRP
irrp = IRRP(gpio=18, filename="codes", post=130, no_confirm=True)
irrp.record("light:on")
| 18.625 | 65 | 0.738255 | #!/usr/bin/env python3
from irrp_with_class import IRRP
irrp = IRRP(gpio=18, filename="codes", post=130, no_confirm=True)
irrp.record("light:on")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0df915e8e72c82a175fa9247262af3cd167ca953 | 8,667 | py | Python | src/sagemaker/workflow/retry.py | mufaddal-rohawala/sagemaker-python-sdk | 72c12bb1481c368f799b17c38d07c5fc34864093 | [
"Apache-2.0"
] | 1 | 2021-12-10T16:18:29.000Z | 2021-12-10T16:18:29.000Z | src/sagemaker/workflow/retry.py | bobbywlindsey/sagemaker-python-sdk | b2d4744930ec0c3ae40b86950847af0a698ba635 | [
"Apache-2.0"
] | 20 | 2021-09-17T20:50:11.000Z | 2021-12-09T00:29:02.000Z | src/sagemaker/workflow/retry.py | bobbywlindsey/sagemaker-python-sdk | b2d4744930ec0c3ae40b86950847af0a698ba635 | [
"Apache-2.0"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... | 40.690141 | 100 | 0.688243 | # Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... | 0 | 2,512 | 0 | 5,135 | 0 | 0 | 0 | 47 | 205 |
771e07b9fe79cb6eb18f1811a64c4f7aae9a5791 | 3,231 | py | Python | category_upwork/real_estate_proforma_modelling/revenue_complex.py | Anshul-GH/upwork_projects | 600c2ccf79e5ed5cf962f1ae05c59f18ad411f63 | [
"MIT"
] | 2 | 2020-07-23T19:32:58.000Z | 2020-10-24T20:54:09.000Z | category_upwork/real_estate_proforma_modelling/revenue_complex.py | Anshul-GH/upwork_projects | 600c2ccf79e5ed5cf962f1ae05c59f18ad411f63 | [
"MIT"
] | null | null | null | category_upwork/real_estate_proforma_modelling/revenue_complex.py | Anshul-GH/upwork_projects | 600c2ccf79e5ed5cf962f1ae05c59f18ad411f63 | [
"MIT"
] | 1 | 2021-07-11T14:41:04.000Z | 2021-07-11T14:41:04.000Z |
# function to procure the absolute path of the file to be read
if __name__ == "__main__":
# Table 1 - Current In-Place Rents #
# tab seperated file - hence named with .tsv extension
rev_fname = r'source/rev_curr_inplace_rents_inp.tsv'
rev_fpath = get_file_path(rev_fname)
# read ... | 34.37234 | 151 | 0.70783 | import pandas as pd
import os
import re
# function to procure the absolute path of the file to be read
def get_file_path(filename):
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
filepath = os.path.join(__location__, filename)
return filepath
def gen_rev_aggr(rev_da... | 0 | 0 | 0 | 0 | 0 | 2,473 | 0 | -26 | 180 |
4979d95315881dfc6cf912c69e031260fa580005 | 12,307 | py | Python | Modeling/fitting_motion.py | jkluter/MLG | 0ef337c1f08f3ad22a8530091c1e6e5548e4a244 | [
"MIT"
] | null | null | null | Modeling/fitting_motion.py | jkluter/MLG | 0ef337c1f08f3ad22a8530091c1e6e5548e4a244 | [
"MIT"
] | null | null | null | Modeling/fitting_motion.py | jkluter/MLG | 0ef337c1f08f3ad22a8530091c1e6e5548e4a244 | [
"MIT"
] | null | null | null | __all__ = ['Fit_Motion','FitFunction_Motion','FitFunction_Motion_Scandir','Jacobian_Motion',\
'Jacobian_Motion_Scandir','Partial_Motion_no_Mass','Jac_Motion_Index' ]
from scipy.optimize import least_squares
import numpy as np
from MLG.Microlensing.const import const_Einsteinradius
from MLG.StellarMotion import getSu... | 35.880466 | 109 | 0.585927 | __all__ = ['Fit_Motion','FitFunction_Motion','FitFunction_Motion_Scandir','Jacobian_Motion',\
'Jacobian_Motion_Scandir','Partial_Motion_no_Mass','Jac_Motion_Index' ]
from scipy.optimize import least_squares
import numpy as np
from MLG.Microlensing.const import const_Einsteinradius
from MLG.StellarMotion import getS... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 22 |
97f1a9648949bb2ca82df660b430dbc9cca7835e | 1,200 | py | Python | bin/gff32gtf.py | Gaius-Augustus/TSEBRA-experiments | 6db9441b118fb2fe359a5c4eb36c99bab867358a | [
"ClArtistic"
] | null | null | null | bin/gff32gtf.py | Gaius-Augustus/TSEBRA-experiments | 6db9441b118fb2fe359a5c4eb36c99bab867358a | [
"ClArtistic"
] | null | null | null | bin/gff32gtf.py | Gaius-Augustus/TSEBRA-experiments | 6db9441b118fb2fe359a5c4eb36c99bab867358a | [
"ClArtistic"
] | 1 | 2021-05-06T19:22:11.000Z | 2021-05-06T19:22:11.000Z | #!/usr/bin/env python3
# ==============================================================
# author: Lars Gabriel
#
# gff32gtf.py: Convert gff3 to gtf
# ==============================================================
import argparse
def parseCmd():
"""Parse command line arguments
Returns:
dictionary: Dict... | 30.769231 | 82 | 0.498333 | #!/usr/bin/env python3
# ==============================================================
# author: Lars Gabriel
#
# gff32gtf.py: Convert gff3 to gtf
# ==============================================================
import argparse
def main():
result = []
args = parseCmd()
with open(args.gff, 'r') as file:
... | 0 | 0 | 0 | 0 | 0 | 515 | 0 | 0 | 23 |
6a48acafef1e1994f7cb4fe0505004774905b72e | 9,086 | py | Python | tests/test_preprocessing/test_datetime_features.py | ig248/timeserio | afc2a953a83e763418d417059493ef13a17d349c | [
"MIT"
] | 63 | 2019-07-12T17:16:27.000Z | 2022-02-22T11:06:50.000Z | tests/test_preprocessing/test_datetime_features.py | ig248/timeserio | afc2a953a83e763418d417059493ef13a17d349c | [
"MIT"
] | 34 | 2019-07-30T11:52:09.000Z | 2022-03-28T12:42:02.000Z | tests/test_preprocessing/test_datetime_features.py | ig248/timeserio | afc2a953a83e763418d417059493ef13a17d349c | [
"MIT"
] | 12 | 2019-08-14T05:51:22.000Z | 2021-03-15T09:34:15.000Z |
import timeserio.ini as ini
datetime_column = ini.Columns.datetime
seq_column = f'seq_{ini.Columns.datetime}'
usage_column = ini.Columns.target
| 32.33452 | 79 | 0.678737 | import numpy as np
import numpy.testing as npt
import pandas as pd
import pandas.testing as pdt
import pytest
import datetime
from pandas.api.types import is_numeric_dtype
import timeserio.ini as ini
from timeserio.data.mock import mock_fit_data
from timeserio.preprocessing import PandasDateTimeFeaturizer
from timeser... | 0 | 4,680 | 0 | 0 | 0 | 3,148 | 0 | 339 | 749 |
5dd77b1d6e11815d25518838c65952f5b3e27a23 | 1,273 | py | Python | mbbl_envs/mbbl/util/common/parallel_util.py | hbutsuak95/iv_rl | 0f72a8f077a238237027ea96b7d1160c35ac9959 | [
"MIT"
] | 9 | 2022-01-16T11:27:00.000Z | 2022-03-13T14:04:48.000Z | mbbl_envs/mbbl/util/common/parallel_util.py | hbutsuak95/iv_rl | 0f72a8f077a238237027ea96b7d1160c35ac9959 | [
"MIT"
] | null | null | null | mbbl_envs/mbbl/util/common/parallel_util.py | hbutsuak95/iv_rl | 0f72a8f077a238237027ea96b7d1160c35ac9959 | [
"MIT"
] | null | null | null | # -----------------------------------------------------------------------------
# @brief:
# Define some signals used during parallel
# @author:
# Tingwu Wang
# -----------------------------------------------------------------------------
TRAIN_SIGNAL = 1
SAVE_SIGNAL = 2
# it makes the main trpo agent ... | 23.574074 | 79 | 0.648075 | # -----------------------------------------------------------------------------
# @brief:
# Define some signals used during parallel
# @author:
# Tingwu Wang
# -----------------------------------------------------------------------------
TRAIN_SIGNAL = 1
SAVE_SIGNAL = 2
# it makes the main trpo agent ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5da216184231f1953daf0136aa0b96781700bc6b | 7,255 | py | Python | python/tests/spatial_operator/test_point_join.py | andreicovaliov/incubator-sedona | 3613a756d6e9a50fd2cb7cb0484e654249440598 | [
"Apache-2.0"
] | 747 | 2016-03-02T21:29:54.000Z | 2020-09-01T01:45:13.000Z | python/tests/spatial_operator/test_point_join.py | andreicovaliov/incubator-sedona | 3613a756d6e9a50fd2cb7cb0484e654249440598 | [
"Apache-2.0"
] | 329 | 2016-04-01T20:30:38.000Z | 2020-08-31T23:29:02.000Z | python/tests/spatial_operator/test_point_join.py | andreicovaliov/incubator-sedona | 3613a756d6e9a50fd2cb7cb0484e654249440598 | [
"Apache-2.0"
] | 401 | 2016-03-03T20:38:38.000Z | 2020-08-31T07:59:13.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 45.062112 | 119 | 0.764438 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 0 | 0 | 0 | 5,070 | 0 | 237 | 0 | 151 | 157 |
74df7800477d09fe6cb14dc956288216ddc2e5ce | 27,198 | py | Python | src/data/fields.py | hummat/convolutional_occupancy_networks | bb351edff59c196e01aa687943e19fee4ac11077 | [
"MIT"
] | null | null | null | src/data/fields.py | hummat/convolutional_occupancy_networks | bb351edff59c196e01aa687943e19fee4ac11077 | [
"MIT"
] | null | null | null | src/data/fields.py | hummat/convolutional_occupancy_networks | bb351edff59c196e01aa687943e19fee4ac11077 | [
"MIT"
] | null | null | null |
# 3D Fields
| 36.953804 | 119 | 0.572395 | import os
from typing import Union, Tuple
import numpy as np
import open3d as o3d
import trimesh
from easy_o3d.utils import get_camera_parameters_from_blenderproc_bopwriter, convert_depth_image_to_point_cloud
from scipy.spatial.transform import Rotation
from src.common import coord2index, normalize_coord, look_at, ge... | 0 | 0 | 0 | 26,506 | 0 | 0 | 0 | 218 | 451 |
b59255e36eb058e5ad45b1c475a2bf131a121ea1 | 514 | py | Python | src/app/users/serialize.py | qinshuang/ITINFO-api | 4699035790d9184d1bf4e9b54455c8e2cdd0200f | [
"MIT"
] | null | null | null | src/app/users/serialize.py | qinshuang/ITINFO-api | 4699035790d9184d1bf4e9b54455c8e2cdd0200f | [
"MIT"
] | null | null | null | src/app/users/serialize.py | qinshuang/ITINFO-api | 4699035790d9184d1bf4e9b54455c8e2cdd0200f | [
"MIT"
] | null | null | null | #!usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author:sqin
@file: serializes.py
@time: 2019/01/02
"""
| 19.769231 | 90 | 0.636187 | #!usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author:sqin
@file: serializes.py
@time: 2019/01/02
"""
from flask_marshmallow import Schema
from marshmallow import fields
from .models import *
from . import ma
class RoleSchema(Schema):
class Meta:
model = Role
fields = ('id', 'name')
class User... | 0 | 0 | 0 | 255 | 0 | 0 | 0 | 19 | 134 |
8eb0707d2d7dedb71848ed46a79e4506014ee097 | 1,664 | py | Python | escola/tests/helpers/utils.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 1 | 2019-03-15T18:04:24.000Z | 2019-03-15T18:04:24.000Z | escola/tests/helpers/utils.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 22 | 2019-03-17T21:53:50.000Z | 2021-03-31T19:12:19.000Z | escola/tests/helpers/utils.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 1 | 2018-11-25T03:05:23.000Z | 2018-11-25T03:05:23.000Z | import pytest
pytestmark = pytest.mark.django_db
| 28.689655 | 95 | 0.702524 | import pytest
from django.contrib.auth.models import User
from django.utils.datetime_safe import datetime
from mixer.backend.django import mixer
from escola.models import Turma, Profile, Aluno, Professor, MateriaDaTurma, CargoTurma, Horario
from escola.utils import dar_permissao_user
pytestmark = pytest.mark.django_d... | 0 | 0 | 0 | 0 | 0 | 1,199 | 0 | 161 | 249 |
f5aeb08fde8c92b7c2c77d83d6605b547ab2cb5c | 3,819 | py | Python | src/RESNets.py | basiralab/RESNets | 395360ecac7950ce52dcef21e19f555e3aafaea5 | [
"MIT"
] | 5 | 2020-09-27T03:49:24.000Z | 2021-07-30T09:13:52.000Z | src/RESNets.py | basiralab/RESNets | 395360ecac7950ce52dcef21e19f555e3aafaea5 | [
"MIT"
] | null | null | null | src/RESNets.py | basiralab/RESNets | 395360ecac7950ce52dcef21e19f555e3aafaea5 | [
"MIT"
] | 2 | 2020-09-22T10:11:21.000Z | 2021-01-04T00:20:38.000Z |
"""
The implementation of RESNets framework.
Details can be found in the original paper: will be filled when accepted
---------------------------------------------------------------------
This file contains the implementation of three key steps of our RESNets framework:
(1) Embedding of baseline populat... | 47.148148 | 129 | 0.635245 | from .ACE import settings as st
from .ACE.encoder import Encoder
from .netNormExtended import netNormExtended
from .utilities import *
"""
The implementation of RESNets framework.
Details can be found in the original paper: will be filled when accepted
-------------------------------------------------------------... | 4 | 0 | 0 | 0 | 0 | 1,694 | 0 | 47 | 111 |
73de2c05efb1401f9cd34752afdab423431a7194 | 801 | py | Python | effects/uvmap/data/gradient.py | AltairQ/demoscene | 243b13f96263c238a7b8c68b59ac76b9cff4c337 | [
"Artistic-2.0"
] | 80 | 2015-02-10T19:33:04.000Z | 2022-02-12T10:29:43.000Z | effects/uvmap/data/gradient.py | AltairQ/demoscene | 243b13f96263c238a7b8c68b59ac76b9cff4c337 | [
"Artistic-2.0"
] | 30 | 2015-12-19T23:08:22.000Z | 2022-02-25T15:50:47.000Z | effects/uvmap/data/gradient.py | AltairQ/demoscene | 243b13f96263c238a7b8c68b59ac76b9cff4c337 | [
"Artistic-2.0"
] | 17 | 2015-02-10T19:33:31.000Z | 2022-02-24T07:10:57.000Z | #!/usr/bin/env python3 -B
from PIL import Image
from utils import lerp, ccir601
import sys
if __name__ == "__main__":
im1 = Image.open(sys.argv[1])
im2 = Image.open(sys.argv[2])
pal1 = sorted(getcolors(im1), key=ccir601)
pal2 = sorted(getcolors(im2), key=ccir601)
im = Image.new('RGB', (16, 16)... | 24.272727 | 59 | 0.52809 | #!/usr/bin/env python3 -B
from PIL import Image
from utils import lerp, ccir601
import sys
def getcolors(im):
pal = im.getpalette()
return [(pal[i * 3], pal[i * 3 + 1], pal[i * 3 + 2])
for _, i in im.getcolors()]
if __name__ == "__main__":
im1 = Image.open(sys.argv[1])
im2 = Image.open(... | 0 | 0 | 0 | 0 | 0 | 120 | 0 | 0 | 23 |
0881daa1cb9f4b2f71f80adb0abea3dfc0e8ce8a | 341 | py | Python | scripts/for_loop.py | arifulhaqueuc/python-multithreading-example | d986167399332e1839e5415266bb789350068c71 | [
"MIT"
] | 28 | 2019-08-06T18:31:24.000Z | 2021-11-28T19:05:46.000Z | scripts/for_loop.py | arifulhaqueuc/python-multithreading-example | d986167399332e1839e5415266bb789350068c71 | [
"MIT"
] | 7 | 2018-01-12T16:57:50.000Z | 2018-01-29T22:36:48.000Z | scripts/for_loop.py | arifulhaqueuc/python-multithreading-example | d986167399332e1839e5415266bb789350068c71 | [
"MIT"
] | 11 | 2019-10-17T21:45:49.000Z | 2021-09-21T10:08:39.000Z |
if __name__ == "__main__":
Main()
| 18.944444 | 57 | 0.642229 | import time
from threading import Thread
def ThreadFunction(x):
print "sleeping 5 sec from thread %d" % x
time.sleep(5)
print "finished sleeping from thread %d" % x
def Main():
for i in range(10):
myThread = Thread(target=ThreadFunction, args=(i,))
myThread.start()
if __name__ == "__... | 0 | 0 | 0 | 0 | 0 | 207 | 0 | -3 | 90 |
bbea06109d4d8af46127c9ed3f65ee511ef06c91 | 263 | py | Python | text.py | terrifyzhao/address_ner | 9d367be1c8c79a4915579c361d5833d4b476e30b | [
"Apache-2.0"
] | 1 | 2021-07-29T09:11:35.000Z | 2021-07-29T09:11:35.000Z | text.py | terrifyzhao/address_ner | 9d367be1c8c79a4915579c361d5833d4b476e30b | [
"Apache-2.0"
] | null | null | null | text.py | terrifyzhao/address_ner | 9d367be1c8c79a4915579c361d5833d4b476e30b | [
"Apache-2.0"
] | null | null | null | from transformers import BertTokenizerFast
model_path = '/Users/joezhao/Documents/pretrain model/chinese_roberta_wwm_ext_L-12_H-768_A-12'
tokenizer = BertTokenizerFast.from_pretrained(model_path)
print(tokenizer.decode(tokenizer('A0000')['input_ids'])) | 52.6 | 94 | 0.844106 | from transformers import BertTokenizerFast
model_path = '/Users/joezhao/Documents/pretrain model/chinese_roberta_wwm_ext_L-12_H-768_A-12'
tokenizer = BertTokenizerFast.from_pretrained(model_path)
print(tokenizer.decode(tokenizer('朝阳区嘉翔大厦A座0000室')['input_ids'])) | 27 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ec74872bf16841429da5381dddc80cad3078d72a | 3,183 | py | Python | leetcode_python/Stack/valid-parentheses.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Stack/valid-parentheses.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | null | null | null | leetcode_python/Stack/valid-parentheses.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | """
Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
determine if the input string is valid.
An input string is valid if:
Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order.
Note that an empty string is also considered valid.
E... | 23.753731 | 79 | 0.480993 | """
Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
determine if the input string is valid.
An input string is valid if:
Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order.
Note that an empty string is also considered valid.
E... | 0 | 0 | 0 | 2,151 | 0 | 0 | 0 | 0 | 132 |
c3fbfd68b81bd91db4d534cc82821e38718c0296 | 2,831 | py | Python | Counter.py | TPCD/DailyReadPaper | 4ee6cc77f4f7752ad14ec36a72cc1df5b5c373ed | [
"MIT"
] | 14 | 2019-01-18T10:01:02.000Z | 2021-05-10T14:14:19.000Z | Counter.py | TPCD/DailyReadPaper | 4ee6cc77f4f7752ad14ec36a72cc1df5b5c373ed | [
"MIT"
] | null | null | null | Counter.py | TPCD/DailyReadPaper | 4ee6cc77f4f7752ad14ec36a72cc1df5b5c373ed | [
"MIT"
] | null | null | null | import re
def counter(file = 'README.md'):
"""
read .md or .txt format file
:param file: .md or .txt format file
:return: data
"""
num = 0
with open(file, 'r', encoding='UTF-8') as f:
lines = f.readlines()
for line in lines:
p1 = re.compile(r'[{](.*?)[}]', re.S) #
... | 34.950617 | 101 | 0.456729 | import time
import os
import re
def counter(file = 'README.md'):
"""
read .md or .txt format file
:param file: .md or .txt format file
:return: data
"""
num = 0
with open(file, 'r', encoding='UTF-8') as f:
lines = f.readlines()
for line in lines:
p1 = re.compile(r'[{](.*... | 60 | 0 | 0 | 0 | 0 | 2,159 | 0 | -22 | 113 |
3536085a487b700759af749256bd8e79895a6608 | 4,021 | py | Python | symchar.py | chrisryba/symmetric-group | beffbda316c48958d067abd91ef6445c3fa04221 | [
"MIT"
] | 1 | 2021-11-09T14:56:28.000Z | 2021-11-09T14:56:28.000Z | symchar.py | chrisryba/symmetric-group | beffbda316c48958d067abd91ef6445c3fa04221 | [
"MIT"
] | null | null | null | symchar.py | chrisryba/symmetric-group | beffbda316c48958d067abd91ef6445c3fa04221 | [
"MIT"
] | null | null | null | # Christopher Ryba, 2016
# This code calculates the character values \chi_\mu^\lambda of the
# symmetric groups. Here \lambda and \mu are partitions of the same size,
# represented as either lists or tuples of integers without trailing zeros.
# The function that returns the character value is char_val, so an example
... | 34.076271 | 82 | 0.703059 | # Christopher Ryba, 2016
# This code calculates the character values \chi_\mu^\lambda of the
# symmetric groups. Here \lambda and \mu are partitions of the same size,
# represented as either lists or tuples of integers without trailing zeros.
# The function that returns the character value is char_val, so an example
... | 0 | 0 | 0 | 0 | 0 | 2,543 | 0 | 5 | 110 |
6e3d1ea7b5863385463aa80119a646e45b97f8e1 | 5,222 | py | Python | project_evolution/project_evol.py | Anonymous-double-blind/ReplicationTool | 38f6b13fd91e477f3b58c60725696cba3fc844f6 | [
"BSD-3-Clause"
] | null | null | null | project_evolution/project_evol.py | Anonymous-double-blind/ReplicationTool | 38f6b13fd91e477f3b58c60725696cba3fc844f6 | [
"BSD-3-Clause"
] | null | null | null | project_evolution/project_evol.py | Anonymous-double-blind/ReplicationTool | 38f6b13fd91e477f3b58c60725696cba3fc844f6 | [
"BSD-3-Clause"
] | null | null | null | import sqlite3
from sqlite3 import Error
import logging
logging.basicConfig(filename='commits.log', filemode='a',
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
#logging.getLogger().addHandler(logging.StreamHandler(sys.stdout))
def create_connection(db_file):
""" crea... | 38.116788 | 148 | 0.675029 | import sqlite3
from sqlite3 import Error
import pathlib
import logging
import sys
import os, shutil
import time
from pydriller import GitRepository
from Model_commits_info import Model_commits_info_Controller
from Project_commits_info import Project_commits_info_Controller
from Project_commits_verbatim import Project... | 0 | 0 | 0 | 0 | 0 | 3,719 | 0 | 242 | 336 |
9c10636ce55f6757e281f8ecb92da1fa3d6e5b76 | 5,311 | py | Python | wappsto/data_operation/encoder.py | mads-slx/wappsto-python | 9ddc5cf0c3b761fb826baf00564da4e4d4048d7d | [
"Apache-2.0"
] | null | null | null | wappsto/data_operation/encoder.py | mads-slx/wappsto-python | 9ddc5cf0c3b761fb826baf00564da4e4d4048d7d | [
"Apache-2.0"
] | null | null | null | wappsto/data_operation/encoder.py | mads-slx/wappsto-python | 9ddc5cf0c3b761fb826baf00564da4e4d4048d7d | [
"Apache-2.0"
] | null | null | null | """
The wappsto encoding module.
Handles encoding object instances to a JSON file.
"""
| 27.376289 | 76 | 0.528337 | """
The wappsto encoding module.
Handles encoding object instances to a JSON file.
"""
import logging
from ..connection.seluxit_rpc import SeluxitRpc
class WappstoEncoder:
"""
The wappsto encoding class.
Handles encoding the current runtime object instances into JSON. This
allows the system to be sa... | 0 | 0 | 0 | 5,136 | 0 | 0 | 0 | 19 | 67 |
2e06b61157077503b56b3e36f0b0a187aeeb0df3 | 717 | py | Python | rest/taskrouter/worker-reservations/accept/example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 2 | 2017-11-23T11:31:20.000Z | 2018-01-22T04:14:02.000Z | rest/taskrouter/worker-reservations/accept/example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | null | null | null | rest/taskrouter/worker-reservations/accept/example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 2 | 2020-05-22T23:31:21.000Z | 2021-06-10T18:33:45.000Z | # Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioTaskRouterClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
w... | 37.736842 | 72 | 0.835425 | # Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioTaskRouterClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
w... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
37cdcaa86634e81a02a7dec208ceaf45adc2d905 | 898 | py | Python | 2021-01-13/solution.py | ammardodin/daily-coding-problem | 8cdc335912ffe35a9e5b5f58d505541537878efb | [
"MIT"
] | null | null | null | 2021-01-13/solution.py | ammardodin/daily-coding-problem | 8cdc335912ffe35a9e5b5f58d505541537878efb | [
"MIT"
] | null | null | null | 2021-01-13/solution.py | ammardodin/daily-coding-problem | 8cdc335912ffe35a9e5b5f58d505541537878efb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
assert make_palindrome("") == ""
assert make_palindrome("a") == "a"
assert make_palindrome("aab") == "aba"
assert make_palindrome("aaa") == "aaa"
assert(make_palindrome("bbaa")) == "baab"
assert(make_palindrome("aaaabbc")) == "aabcbaa"
assert(make_palindrome("bab")) == "bab"
| 24.27027 | 49 | 0.555679 | #!/usr/bin/env python3
from collections import OrderedDict
def make_palindrome(candidate):
freq = OrderedDict()
for c in candidate:
freq[c] = freq.get(c, 0) + 1
num_odd = 0
odd_char = ''
for c, f in freq.items():
if f & 1:
num_odd = num_odd + 1
odd_char = c
... | 0 | 0 | 0 | 0 | 0 | 538 | 0 | 14 | 46 |
1f4c385ecb2322a200728d566cb11ab9b1736625 | 912 | py | Python | setup.py | knyazz/py3-django-enriched-carton | 27d97388d8153f29a3c629cdcd3e734ad09dc52e | [
"MIT"
] | null | null | null | setup.py | knyazz/py3-django-enriched-carton | 27d97388d8153f29a3c629cdcd3e734ad09dc52e | [
"MIT"
] | null | null | null | setup.py | knyazz/py3-django-enriched-carton | 27d97388d8153f29a3c629cdcd3e734ad09dc52e | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
import carton
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name='py3-django-enriched-carton',
version=carton.__version__,
description=carton.__doc__,
packages=find_packages(),
url='https://github.com/kny... | 27.636364 | 71 | 0.658991 | from setuptools import setup, find_packages
import carton
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name='py3-django-enriched-carton',
version=carton.__version__,
description=carton.__doc__,
packages=find_packages(),
url='https://github.com/kny... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9b9a96ec9f05a33ddd66edb2fc987a40856db6ce | 138 | py | Python | data/projects.py | OlgaSidortcova/python_training_mantis | 8854c6aa3cb5aaede161dafd22b04a9c69ce23f2 | [
"Apache-2.0"
] | null | null | null | data/projects.py | OlgaSidortcova/python_training_mantis | 8854c6aa3cb5aaede161dafd22b04a9c69ce23f2 | [
"Apache-2.0"
] | null | null | null | data/projects.py | OlgaSidortcova/python_training_mantis | 8854c6aa3cb5aaede161dafd22b04a9c69ce23f2 | [
"Apache-2.0"
] | null | null | null | from model.project import Project
testdata = [
Project(name="name1", description="1"),
Project(name="name2", description="2")
]
| 17.25 | 43 | 0.673913 | from model.project import Project
testdata = [
Project(name="name1", description="1"),
Project(name="name2", description="2")
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dc25502ccebc37ea53b9519a66a4578f19a8c306 | 2,387 | py | Python | banner_merge_analysis/mutil_banner_extract.py | Achelics/mutil_device_recongition | be92835f6bf3fc7acd2e1d9f48ad883b7ccf55a2 | [
"Apache-2.0"
] | 3 | 2017-05-04T05:22:34.000Z | 2017-05-04T06:24:12.000Z | banner_merge_analysis/mutil_banner_extract.py | Achelics/mutil_device_recongition | be92835f6bf3fc7acd2e1d9f48ad883b7ccf55a2 | [
"Apache-2.0"
] | null | null | null | banner_merge_analysis/mutil_banner_extract.py | Achelics/mutil_device_recongition | be92835f6bf3fc7acd2e1d9f48ad883b7ccf55a2 | [
"Apache-2.0"
] | 1 | 2020-04-24T10:47:03.000Z | 2020-04-24T10:47:03.000Z | #!/usr/bin/env/ python
# coding=utf-8
__author__ = 'Achelics'
__Date__ = '2017/05/16'
import os
import json as _json
def get_ip_banner(path, filename, protocol_validity_json):
"""
ip
:param path:
:param filename:
:param protocol_validity_json:
:return:
"""
file_name = os.path.jo... | 33.619718 | 133 | 0.639296 | #!/usr/bin/env/ python
# coding=utf-8
__author__ = 'Achelics'
__Date__ = '2017/05/16'
from data_pre_process.split_banner_man import *
import os
import json as _json
def get_ip_banner(path, filename, protocol_validity_json):
"""
提取ip和标语
:param path: 标语文件所在路径
:param filename: 标语文件名称
:param prot... | 156 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 23 |
13a6fae8da1fa7a0392739a0f6188e36f1014e72 | 4,460 | py | Python | main.py | ajayreddychinthala/Python-Assistant | 060ad3efd713985df57a57863fe2d65a4b3de5eb | [
"MIT"
] | 3 | 2020-11-07T13:33:44.000Z | 2021-02-03T05:57:12.000Z | main.py | ajayreddychinthala/Jarvis | 060ad3efd713985df57a57863fe2d65a4b3de5eb | [
"MIT"
] | null | null | null | main.py | ajayreddychinthala/Jarvis | 060ad3efd713985df57a57863fe2d65a4b3de5eb | [
"MIT"
] | null | null | null |
engine = pyttsx3.init('sapi5')
client = wolframalpha.Client('33UPA7-YGAUU4EYQA')
voices = engine.getProperty('voices')
#engine.setProperty('voice', voices[2].id)
engine.setProperty('voices',voices[len(voices)-1])
#engine.setProperty('voice', voices[1].id)
engine.setProperty('rate', 135)
greetme()
sp... | 34.573643 | 99 | 0.546861 | import requirements
from requirements import *
engine = pyttsx3.init('sapi5')
client = wolframalpha.Client('33UPA7-YGAUU4EYQA')
voices = engine.getProperty('voices')
#engine.setProperty('voice', voices[2].id)
engine.setProperty('voices',voices[len(voices)-1])
#engine.setProperty('voice', voices[1].id)
eng... | 0 | 0 | 0 | 0 | 0 | 741 | 0 | 3 | 119 |
c21d46ef93adca908adaa1dd261cbd4b98a31a90 | 504 | py | Python | sample/old/fx.py | Hyper-Devil/learn-python3 | c097158c48b9f6804c8c46aebf00025249089bf6 | [
"MIT"
] | null | null | null | sample/old/fx.py | Hyper-Devil/learn-python3 | c097158c48b9f6804c8c46aebf00025249089bf6 | [
"MIT"
] | null | null | null | sample/old/fx.py | Hyper-Devil/learn-python3 | c097158c48b9f6804c8c46aebf00025249089bf6 | [
"MIT"
] | null | null | null | #
print_hello()
# fuckfuck
r = print_str("fuck")
print(r)
#
print_default()
print_default("default")
#
print_args("hello")
print_args("hello", "world", "1")
#
print_two(a="a", b="b")
print_two(b="b", a="a")
| 10.723404 | 33 | 0.597222 | # 无参数
def print_hello():
print("hello")
print_hello()
# 带参数 fuckfuck
def print_str(s):
print(s)
return s * 2
r = print_str("fuck")
print(r)
# 带默认参数
def print_default(s="hello"):
print(s)
print_default()
print_default("default")
# 不定长参数
def print_args(s, *arg):
print(s)
for a in arg:... | 69 | 0 | 0 | 0 | 0 | 140 | 0 | 0 | 110 |
6b595b2ab939856deaa60fba086d791d3431873f | 1,109 | py | Python | data/src/demos/coordinates_from_kml.py | blackradley/heathmynd | 4495f8fadef9d3a36a7d5b49fae2b61cceb158bc | [
"MIT"
] | null | null | null | data/src/demos/coordinates_from_kml.py | blackradley/heathmynd | 4495f8fadef9d3a36a7d5b49fae2b61cceb158bc | [
"MIT"
] | 4 | 2018-11-06T16:15:10.000Z | 2018-11-07T12:03:09.000Z | data/src/demos/coordinates_from_kml.py | blackradley/heathmynd | 4495f8fadef9d3a36a7d5b49fae2b61cceb158bc | [
"MIT"
] | null | null | null | '''
Get the coordinates of a wikipage from some KML.
Joe Collins
26 March 2011
'''
import re # for regular expressions
import string
kml = '''<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<name><![CDATA[Bedford Museum & Art Gallery]]></name>
<open>1</open>
<Folder>... | 27.725 | 172 | 0.65284 | '''
Get the coordinates of a wikipage from some KML.
Joe Collins
26 March 2011
'''
import re # for regular expressions
import string
kml = '''<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<name><![CDATA[Bedford Museum & Art Gallery]]></name>
<open>1</open>
<Folder>... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0c45d33c85b30a831e100612f11bf2d2d5b5d889 | 314 | py | Python | ProjectEuler.Problem.031.py | jihunroh/ProjectEuler-Python | 2fceaf5c3dd61038004b6128c5d9ee7a76142bca | [
"MIT"
] | null | null | null | ProjectEuler.Problem.031.py | jihunroh/ProjectEuler-Python | 2fceaf5c3dd61038004b6128c5d9ee7a76142bca | [
"MIT"
] | null | null | null | ProjectEuler.Problem.031.py | jihunroh/ProjectEuler-Python | 2fceaf5c3dd61038004b6128c5d9ee7a76142bca | [
"MIT"
] | null | null | null |
Answer(
count_summation_way(200, [200, 100, 50, 20, 10, 5, 2, 1])
)
"""
------------------------------------------------
ProjectEuler.Problem.031.py
The Answer is: 73682
Time Elasped: 0.07277131080627441sec
------------------------------------------------
"""
| 22.428571 | 61 | 0.471338 | from ProjectEulerCommons.Base import *
Answer(
count_summation_way(200, [200, 100, 50, 20, 10, 5, 2, 1])
)
"""
------------------------------------------------
ProjectEuler.Problem.031.py
The Answer is: 73682
Time Elasped: 0.07277131080627441sec
------------------------------------------------
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 22 |
6aad439b193dae598f60608dc43e734d67715e78 | 129 | py | Python | scraper/apps.py | Spferical/cure-alzheimers-fund-tracker | 1b3ad0e8c3fc29fb8640b3ffe525daa3fa5fcafb | [
"MIT"
] | null | null | null | scraper/apps.py | Spferical/cure-alzheimers-fund-tracker | 1b3ad0e8c3fc29fb8640b3ffe525daa3fa5fcafb | [
"MIT"
] | null | null | null | scraper/apps.py | Spferical/cure-alzheimers-fund-tracker | 1b3ad0e8c3fc29fb8640b3ffe525daa3fa5fcafb | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
| 18.428571 | 39 | 0.79845 | from __future__ import unicode_literals
from django.apps import AppConfig
class ScraperConfig(AppConfig):
name = 'scraper'
| 0 | 0 | 0 | 31 | 0 | 0 | 0 | 12 | 45 |
33d5fefcbcca63ab6fc4a2b2e21930f85104a8f0 | 482 | py | Python | tuna/__main__.py | kernelmachine/tuna | 7680efa522d0f97c80decb6555c721a413faba33 | [
"Apache-2.0"
] | 25 | 2019-01-30T13:01:08.000Z | 2020-10-01T15:00:05.000Z | tuna/__main__.py | kernelmachine/tuna | 7680efa522d0f97c80decb6555c721a413faba33 | [
"Apache-2.0"
] | null | null | null | tuna/__main__.py | kernelmachine/tuna | 7680efa522d0f97c80decb6555c721a413faba33 | [
"Apache-2.0"
] | 3 | 2019-02-20T22:02:46.000Z | 2019-07-18T11:54:10.000Z | #!/usr/bin/env python
import logging
import os
if os.environ.get("TUNA_DEBUG"):
LEVEL = logging.DEBUG
else:
LEVEL = logging.INFO
logging.basicConfig(
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", level=LEVEL
)
if __name__ == "__main__":
main()
| 17.851852 | 78 | 0.690871 | #!/usr/bin/env python
import sys
import logging
import os
from tuna.runners import AllenNlpRunner
from tuna.executors import RayExecutor
if os.environ.get("TUNA_DEBUG"):
LEVEL = logging.DEBUG
else:
LEVEL = logging.INFO
logging.basicConfig(
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", le... | 0 | 0 | 0 | 0 | 0 | 86 | 0 | 24 | 90 |
7c13f825e64f3e01124ab7b15de450da2308493d | 545 | py | Python | src/09/urls.py | rvalle71mx/PY201 | ac5cc75371c2f3a658dd6483da3f8effe4a492d7 | [
"MIT"
] | 9 | 2018-05-07T06:25:07.000Z | 2021-11-10T15:22:00.000Z | src/09/urls.py | rvalle71mx/PY201 | ac5cc75371c2f3a658dd6483da3f8effe4a492d7 | [
"MIT"
] | null | null | null | src/09/urls.py | rvalle71mx/PY201 | ac5cc75371c2f3a658dd6483da3f8effe4a492d7 | [
"MIT"
] | 4 | 2018-05-18T01:02:46.000Z | 2021-01-29T17:55:03.000Z | from django.urls import path, re_path
from . import views
urlpatterns = [path('', views.index, name="inicio"),
path('vista', views.vista),
re_path(r'^claves/(?P<clave>[0-9]{4}$)', views.clave),
path('claves/<int:numero>', views.numero),
path('clave... | 41.923077 | 70 | 0.526606 | from django.urls import path, re_path
from . import views
urlpatterns = [path('', views.index, name="inicio"),
path('vista', views.vista),
re_path(r'^claves/(?P<clave>[0-9]{4}$)', views.clave),
path('claves/<int:numero>', views.numero),
path('clave... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5da4c52fd4ad3ef40280997a7b6626dcbf2df3e7 | 2,414 | py | Python | peers.py | Someguy123/steem-peers | b96845b682386cbe37601319daf8881bf1dd0254 | [
"Linux-OpenIB"
] | 7 | 2020-03-27T22:44:14.000Z | 2021-11-10T00:47:19.000Z | peers.py | Someguy123/steem-peers | b96845b682386cbe37601319daf8881bf1dd0254 | [
"Linux-OpenIB"
] | null | null | null | peers.py | Someguy123/steem-peers | b96845b682386cbe37601319daf8881bf1dd0254 | [
"Linux-OpenIB"
] | 2 | 2019-09-09T08:36:40.000Z | 2020-03-27T22:44:03.000Z | #!/usr/bin/env python3
######################################
# Steem Peers Scanner - Main Python Script
# Part of https://github.com/someguy123/steem-peers
#
# Usage:
#
# sudo -H pip3 install -r requirements.txt
# sudo ./update_geoip.sh
# sudo ./peers.py
#
#
# Environment Options (place in .env or pass on comma... | 36.575758 | 141 | 0.71541 | #!/usr/bin/env python3
######################################
# Steem Peers Scanner - Main Python Script
# Part of https://github.com/someguy123/steem-peers
#
# Usage:
#
# sudo -H pip3 install -r requirements.txt
# sudo ./update_geoip.sh
# sudo ./peers.py
#
#
# Environment Options (place in .env or pass on comma... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4b5e74bae2f750805bbfc08bccdb2b2f77a16eda | 314 | py | Python | brick/ida/modules/postprocessor/uefi/smm/cpu/__init__.py | nstarke/brick | cab44da77458d6cd22411c1d3b5f3e9775db4a0b | [
"MIT"
] | 60 | 2021-06-20T15:12:41.000Z | 2022-03-29T10:47:01.000Z | brick/ida/modules/postprocessor/uefi/smm/cpu/__init__.py | nstarke/brick | cab44da77458d6cd22411c1d3b5f3e9775db4a0b | [
"MIT"
] | 3 | 2021-09-21T14:20:57.000Z | 2022-02-06T23:31:56.000Z | brick/ida/modules/postprocessor/uefi/smm/cpu/__init__.py | nstarke/brick | cab44da77458d6cd22411c1d3b5f3e9775db4a0b | [
"MIT"
] | 7 | 2021-06-20T16:31:28.000Z | 2022-03-29T10:47:03.000Z | from ...factory.factory import UefiCallFactory
from .ReadSaveState import ReadSaveStateCall
from .WriteSaveState import WriteSaveStateCall
SmmCpuCallsFactory = UefiCallFactory()
SmmCpuCallsFactory.register('ReadSaveState', ReadSaveStateCall)
SmmCpuCallsFactory.register('WriteSaveState', WriteSaveStateCall) | 39.25 | 67 | 0.853503 | from ...factory.factory import UefiCallFactory
from .ReadSaveState import ReadSaveStateCall
from .WriteSaveState import WriteSaveStateCall
SmmCpuCallsFactory = UefiCallFactory()
SmmCpuCallsFactory.register('ReadSaveState', ReadSaveStateCall)
SmmCpuCallsFactory.register('WriteSaveState', WriteSaveStateCall) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
91ae7bb083d2e1da851899441a176b3018e46916 | 1,337 | py | Python | platform_cli/protected_file_path.py | dtweet/platform_cli | 89c1c29096551f0490c3fb81b47d4f4cdaa3aca4 | [
"Apache-2.0"
] | 1 | 2017-05-03T07:16:17.000Z | 2017-05-03T07:16:17.000Z | platform_cli/protected_file_path.py | dtweet/platform_cli | 89c1c29096551f0490c3fb81b47d4f4cdaa3aca4 | [
"Apache-2.0"
] | null | null | null | platform_cli/protected_file_path.py | dtweet/platform_cli | 89c1c29096551f0490c3fb81b47d4f4cdaa3aca4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (C) 2013 Jive Software. All rights reserved.
"""Context manager marking a path with a .lock directory for exclusive access.
"""
| 27.854167 | 78 | 0.641735 | #!/usr/bin/env python
# Copyright (C) 2013 Jive Software. All rights reserved.
"""Context manager marking a path with a .lock directory for exclusive access.
"""
import os
import time
class Error(Exception):
"""Base exception class for this module."""
class ProtectedFilePath(object):
"""Context manager for ex... | 0 | 0 | 0 | 1,102 | 0 | 0 | 0 | -22 | 91 |
0e89cf6ee03cfac2010e4277c0cc5038363e3a0d | 502 | py | Python | tests.py | spddb/spddb | f8156090026dee363b49203dfa920639fc44b7d7 | [
"MIT"
] | 1 | 2018-05-31T14:45:35.000Z | 2018-05-31T14:45:35.000Z | tests.py | spddb/spddb | f8156090026dee363b49203dfa920639fc44b7d7 | [
"MIT"
] | null | null | null | tests.py | spddb/spddb | f8156090026dee363b49203dfa920639fc44b7d7 | [
"MIT"
] | null | null | null |
db = ziverdb("hello.db")
db.insert("hello", "world")
print db.have("hello") == True
print db.get("hello") == "world"
print db.getsize() == 18
print db.getkeys() == ['hello']
db.delete("hello")
print db.have("hello") == False
print db.get("hello") == False
print db.getsize() == 2
os.remove("hello.db")
... | 11.674419 | 32 | 0.61753 | from spddb import *
db = ziverdb("hello.db")
db.insert("hello", "world")
print db.have("hello") == True
print db.get("hello") == "world"
print db.getsize() == 18
print db.getkeys() == ['hello']
db.delete("hello")
print db.have("hello") == False
print db.get("hello") == False
print db.getsize() == 2
o... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 23 |