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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
01fec71a21a3dc4ae1e01434284b6e698cc857a1 | 912 | py | Python | narcissistic.py | GGSimmons1992/CodewarsPython | 795e1e38cc9043f2228c7d5a4bf94c8446ae2727 | [
"MIT"
] | 1 | 2019-03-01T00:15:36.000Z | 2019-03-01T00:15:36.000Z | narcissistic.py | GGSimmons1992/CodewarsPython | 795e1e38cc9043f2228c7d5a4bf94c8446ae2727 | [
"MIT"
] | null | null | null | narcissistic.py | GGSimmons1992/CodewarsPython | 795e1e38cc9043f2228c7d5a4bf94c8446ae2727 | [
"MIT"
] | null | null | null | """
Gary Simmons
March 2018
Kata Prompt Description: A Narcissistic Number is a number which is the sum of its own digits, each raised to the power of the number of digits in a given base. In this Kata, we will restrict ourselves to decimal (base 10).
For example, take 153 (3 digits):
1^3 + 5^3 + 3^3 = 1 + 125 +... | 31.448276 | 223 | 0.701754 | """
Gary Simmons
March 2018
Kata Prompt Description: A Narcissistic Number is a number which is the sum of its own digits, each raised to the power of the number of digits in a given base. In this Kata, we will restrict ourselves to decimal (base 10).
For example, take 153 (3 digits):
1^3 + 5^3 + 3^3 = 1 + 125 +... | 0 | 0 | 0 | 0 | 0 | 221 | 0 | 0 | 22 |
ff73cfec6bbcc04feed5f59b9ae989efec03fae8 | 1,552 | py | Python | core/utils/Worker.py | xingfeT/mirageMan | 7443bce072817adc843c5e34468f1dab32cb48ae | [
"Apache-2.0"
] | null | null | null | core/utils/Worker.py | xingfeT/mirageMan | 7443bce072817adc843c5e34468f1dab32cb48ae | [
"Apache-2.0"
] | null | null | null | core/utils/Worker.py | xingfeT/mirageMan | 7443bce072817adc843c5e34468f1dab32cb48ae | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from rq import Connection, Worker
from core.utils.Executor import check_output
__workers__ = [
'alpha',
'beta',
'gamma',
'delta',
'epsilon',
'zeta',
'eta',
'theta',
'iota',
'kappa',
'lambda',
'mu',
'nu',
'xi',
'omicron',
'pi',
'... | 18.046512 | 71 | 0.567655 | #!/usr/bin/env python
import logging
from daemonize import Daemonize
from rq import Connection, Worker
from core.utils.Executor import check_output
__workers__ = [
'alpha',
'beta',
'gamma',
'delta',
'epsilon',
'zeta',
'eta',
'theta',
'iota',
'kappa',
'lambda',
'mu',
... | 0 | 0 | 0 | 0 | 0 | 483 | 0 | 3 | 68 |
b6c42ddd52e84260db5a55b47c1d05b955befeb3 | 7,371 | py | Python | solution/data/processors/prep.py | taeukkkim/temp | 91c90fe5da4678424d8aacacbf15773dc624021d | [
"MIT"
] | null | null | null | solution/data/processors/prep.py | taeukkkim/temp | 91c90fe5da4678424d8aacacbf15773dc624021d | [
"MIT"
] | null | null | null | solution/data/processors/prep.py | taeukkkim/temp | 91c90fe5da4678424d8aacacbf15773dc624021d | [
"MIT"
] | null | null | null | from solution.utils.constant import (QUESTION_COLUMN_NAME, CONTEXT_COLUMN_NAME, ANSWER_COLUMN_NAME)
def get_extractive_features(tokenizer, mode, data_args):
""" Get extractive features for train, eval and test.
Args:
tokenizer (BERT Tokenizer): tokenizer for preprocessing
mode (str): [descrip... | 36.671642 | 84 | 0.60114 | import re
import numpy as np
from solution.utils.constant import (
QUESTION_COLUMN_NAME,
CONTEXT_COLUMN_NAME,
ANSWER_COLUMN_NAME,
)
def get_extractive_features(tokenizer, mode, data_args):
""" Get extractive features for train, eval and test.
Args:
tokenizer (BERT Tokenizer): tokenizer fo... | 1,041 | 0 | 0 | 0 | 0 | 26 | 0 | 0 | 71 |
71b44fa14fddd3b9884847de5e274d8e96e1a0ae | 4,258 | py | Python | tests/screensize.py | alex1712/kms-core | d197c971693738df39e33e3ecf9dff40ce7fa861 | [
"Apache-2.0"
] | 287 | 2015-01-03T18:27:51.000Z | 2022-03-24T13:48:24.000Z | tests/screensize.py | alex1712/kms-core | d197c971693738df39e33e3ecf9dff40ce7fa861 | [
"Apache-2.0"
] | 22 | 2015-06-05T10:32:16.000Z | 2022-03-14T07:24:02.000Z | tests/screensize.py | alex1712/kms-core | d197c971693738df39e33e3ecf9dff40ce7fa861 | [
"Apache-2.0"
] | 217 | 2015-01-05T14:24:57.000Z | 2022-02-24T07:14:09.000Z | #!/usr/bin/python3
import sys
import gi
gi.require_version('Gst', '1.0')
if __name__ == "__main__":
main(sys.argv)
#self.pipe = Gst.parse_launch ("videotestsrc is-live=true ! capsfilter name=caps ! x264enc speed-preset=superfast ! h264parse ! decodebin ! autovideosink")
| 36.706897 | 319 | 0.716534 | #!/usr/bin/python3
import sys
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst
from gi.repository import GLib
from gi.repository import Gtk
def bus_callback(bus, message, not_used):
t = message.type
if t == Gst.MessageType.EOS:
sys.stdout.write("End-of-stream\n")
Gtk.main_quit()
... | 0 | 0 | 0 | 3,322 | 0 | 494 | 0 | 25 | 135 |
6e34695bf587cf6d83d1b845593c9f45af7b74d9 | 1,858 | py | Python | steinerpy/abstract_algo.py | rooshm/steinerpy | 777b55fa94527365322ba5fa675c8be090333715 | [
"MIT"
] | 3 | 2021-06-10T16:46:20.000Z | 2022-02-11T14:24:15.000Z | steinerpy/abstract_algo.py | rooshm/steinerpy | 777b55fa94527365322ba5fa675c8be090333715 | [
"MIT"
] | 12 | 2021-03-31T03:31:24.000Z | 2021-11-18T21:51:18.000Z | steinerpy/abstract_algo.py | rooshm/steinerpy | 777b55fa94527365322ba5fa675c8be090333715 | [
"MIT"
] | 1 | 2021-06-13T15:01:24.000Z | 2021-06-13T15:01:24.000Z | """A module with the class `AbstractAlgorithm` defined"""
# from abc import ABC, abstractmethod | 37.918367 | 92 | 0.655005 | """A module with the class `AbstractAlgorithm` defined"""
# from abc import ABC, abstractmethod
from abc import abstractmethod
from steinerpy.library.misc.abc_utils import abstract_attribute, ABC as newABC
from steinerpy.library.graphs.graph import IGraph
from typing import List
class AbstractAlgorithm(newABC):
"... | 0 | 213 | 0 | 1,342 | 0 | 0 | 0 | 96 | 111 |
5a401582065b6cfbb9f8df5ad1f1e65bd2e6695b | 550 | py | Python | 2020/udp_server.py | aleimu/code-puzzle | 1aaa86e6b49e1fe15a2a6c6be22badd783594024 | [
"MIT"
] | null | null | null | 2020/udp_server.py | aleimu/code-puzzle | 1aaa86e6b49e1fe15a2a6c6be22badd783594024 | [
"MIT"
] | null | null | null | 2020/udp_server.py | aleimu/code-puzzle | 1aaa86e6b49e1fe15a2a6c6be22badd783594024 | [
"MIT"
] | null | null | null | from time import ctime
HOST = ''
PORT = 8888
BUFSIZ = 1024
ADDRESS = (HOST, PORT)
udpServerSocket = socket(AF_INET, SOCK_DGRAM)
udpServerSocket.bind(ADDRESS) #
while True:
print("udp waiting for message...")
data, addr = udpServerSocket.recvfrom(BUFSIZ)
print("", data.decode('utf-8'))
content = '[... | 25 | 73 | 0.678182 | from socket import *
from time import ctime
HOST = ''
PORT = 8888
BUFSIZ = 1024
ADDRESS = (HOST, PORT)
udpServerSocket = socket(AF_INET, SOCK_DGRAM)
udpServerSocket.bind(ADDRESS) # 绑定客户端口和地址
while True:
print("udp waiting for message...")
data, addr = udpServerSocket.recvfrom(BUFSIZ)
print("接收到数据:", dat... | 45 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 22 |
8210e4bf0620acb34ec328bb601ed845570d9b37 | 2,128 | py | Python | cloudshell/devices/runners/autoload_runner.py | QualiSystems/cloudshell-networking-devices | f316cefca174975424ec21854b672335feaf8f87 | [
"Apache-2.0"
] | null | null | null | cloudshell/devices/runners/autoload_runner.py | QualiSystems/cloudshell-networking-devices | f316cefca174975424ec21854b672335feaf8f87 | [
"Apache-2.0"
] | 34 | 2016-11-28T10:52:44.000Z | 2019-10-01T08:52:59.000Z | cloudshell/devices/runners/autoload_runner.py | QualiSystems/cloudshell-networking-devices | f316cefca174975424ec21854b672335feaf8f87 | [
"Apache-2.0"
] | 1 | 2017-05-23T08:46:45.000Z | 2017-05-23T08:46:45.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
| 32.738462 | 112 | 0.606203 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from abc import abstractproperty, ABCMeta
from cloudshell.devices.networking_utils import command_logging
from cloudshell.devices.runners.interfaces.autoload_runner_interface import AutoloadOperationsInterface
class AutoloadRunner(AutoloadOperationsInterface):
__metacla... | 0 | 828 | 0 | 1,022 | 0 | 0 | 0 | 144 | 91 |
f134212aed556da4d00930f3d31654d7f980e384 | 1,019 | py | Python | Chapter09/ch9_grover_ancilla.py | PacktPublishing/Quantum-Computing-in-Practice-with-IBM-Q-Experience | 91423f8ff1d039b5eb3fd18fc64bbb5967fdd5c1 | [
"MIT"
] | 24 | 2020-11-21T20:33:51.000Z | 2022-03-26T06:41:27.000Z | Chapter09/ch9_grover_ancilla.py | videomover/Quantum-Computing-in-Practice-with-Qiskit-and-IBM-Quantum-Experience | 938123d051c5bab72110011b3a05e515bb69ca09 | [
"MIT"
] | 2 | 2021-02-07T14:32:12.000Z | 2022-03-25T07:23:46.000Z | Chapter09/ch9_grover_ancilla.py | videomover/Quantum-Computing-in-Practice-with-Qiskit-and-IBM-Quantum-Experience | 938123d051c5bab72110011b3a05e515bb69ca09 | [
"MIT"
] | 16 | 2020-11-03T07:49:11.000Z | 2022-03-26T06:41:29.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created Nov 2020
@author: hassi
"""
from qiskit import QuantumCircuit, Aer, execute
from IPython.core.display import display
from qiskit.tools.visualization import plot_histogram
print("Ch 9: Grover with ancilla qubits")
print("--------------------------------")
# ... | 16.983333 | 53 | 0.664377 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created Nov 2020
@author: hassi
"""
from qiskit import QuantumCircuit, Aer, execute
from IPython.core.display import display
from qiskit.tools.visualization import plot_histogram
print("Ch 9: Grover with ancilla qubits")
print("--------------------------------")
# ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5ed5cc32f654e4a5cca36ab832db215acb10916a | 1,703 | py | Python | pythalesians/market/requests/backtestrequest.py | NunoEdgarGFlowHub/pythalesians | 3ea77b9f52cc704258d55369922955f4010bf4ea | [
"Apache-2.0"
] | 22 | 2017-06-04T21:05:18.000Z | 2022-01-22T19:01:43.000Z | pythalesians/market/requests/backtestrequest.py | NunoEdgarGFlowHub/pythalesians | 3ea77b9f52cc704258d55369922955f4010bf4ea | [
"Apache-2.0"
] | null | null | null | pythalesians/market/requests/backtestrequest.py | NunoEdgarGFlowHub/pythalesians | 3ea77b9f52cc704258d55369922955f4010bf4ea | [
"Apache-2.0"
] | 11 | 2016-10-06T21:25:20.000Z | 2020-07-08T19:13:35.000Z | __author__ = 'saeedamen'
| 25.80303 | 85 | 0.677041 | __author__ = 'saeedamen'
from pythalesians.util.loggermanager import LoggerManager
from pythalesians.market.requests.timeseriesrequest import TimeSeriesRequest
from pythalesians.timeseries.techind.techparams import TechParams
class BacktestRequest(TimeSeriesRequest):
def __init__(self):
super(TimeSeriesR... | 0 | 952 | 0 | 500 | 0 | 0 | 0 | 135 | 90 |
60f942e7943c7c823d5eaeabb57331b57170913c | 2,102 | py | Python | Behavioural Cloning.py | Vishal0703/Udacity_CarND_Behavioural_Cloning | 02a3c2432ce46220a39ba49ec13933269d9d7c21 | [
"MIT"
] | null | null | null | Behavioural Cloning.py | Vishal0703/Udacity_CarND_Behavioural_Cloning | 02a3c2432ce46220a39ba49ec13933269d9d7c21 | [
"MIT"
] | null | null | null | Behavioural Cloning.py | Vishal0703/Udacity_CarND_Behavioural_Cloning | 02a3c2432ce46220a39ba49ec13933269d9d7c21 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[43]:
import cv2
import csv
import numpy as np
# In[44]:
lines = []
with open("./data/driving_log.csv") as dl:
reader = csv.reader(dl)
for line in reader:
lines.append(line)
# In[45]:
lines = lines[1:]
corr = 0.2
source_path = "./data/"
images = [... | 17.965812 | 83 | 0.6451 | #!/usr/bin/env python
# coding: utf-8
# In[43]:
import cv2
import csv
from scipy import ndimage
import numpy as np
# In[44]:
lines = []
with open("./data/driving_log.csv") as dl:
reader = csv.reader(dl)
for line in reader:
lines.append(line)
# In[45]:
lines = lines[1:]
corr = 0.2
source_p... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 45 |
51f18c307bfe7de9cf366c1eff9e4ea3c3bde826 | 4,953 | py | Python | jupyterlab_translate/api.py | fcollonval/jupyterlab-translate | 9c518200c39c431f91ba4c16d162e56f0253ba14 | [
"BSD-3-Clause"
] | 1 | 2020-07-11T22:54:15.000Z | 2020-07-11T22:54:15.000Z | jupyterlab_translate/api.py | goanpeca/jupyterlab-translate | 9c518200c39c431f91ba4c16d162e56f0253ba14 | [
"BSD-3-Clause"
] | null | null | null | jupyterlab_translate/api.py | goanpeca/jupyterlab-translate | 9c518200c39c431f91ba4c16d162e56f0253ba14 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""
API interface.
"""
import os
import shutil
from .constants import EXTENSIONS_FOLDER
from .constants import JUPYTERLAB
from .constants import LANG_PACKS_FOLDER
from .converters import convert_catalog_to_json
from .u... | 28.796512 | 86 | 0.68827 | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""
API interface.
"""
import os
import shutil
from .constants import EXTENSIONS_FOLDER
from .constants import JUPYTERLAB
from .constants import LANG_PACKS_FOLDER
from .constants import LC_MESSAGES
from .constants impo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 28 | 44 |
f87448190a9f21e196edac22d504675466d4f3e3 | 2,279 | py | Python | advent3_triangles.py | mike10004/adventofcode2016 | 2d74ae23f79c9d08366516b285f3eb1e686232b9 | [
"MIT"
] | null | null | null | advent3_triangles.py | mike10004/adventofcode2016 | 2d74ae23f79c9d08366516b285f3eb1e686232b9 | [
"MIT"
] | null | null | null | advent3_triangles.py | mike10004/adventofcode2016 | 2d74ae23f79c9d08366516b285f3eb1e686232b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# advent3_triangles.py
#
import sys
_KNOWN_TRUE = ((5, 12, 13), (3, 3, 3), (200, 300, 450), (2, 1, 2))
_KNOWN_FALSE = ((1, 2, 3), (5, 10, 25))
if __name__ == '__main__':
assert sum(evaluate(_KNOWN_TRUE)) == len(_KNOWN_TRUE)
assert sum(evaluate(_KNOWN_FALSE)) ... | 34.014925 | 166 | 0.637999 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# advent3_triangles.py
#
import itertools
import sys
def triad(t, oddman_index):
pair = tuple([t[i] for i in xrange(len(t)) if i != oddman_index])
oddman = t[oddman_index]
return pair, oddman
def is_triangle(t):
a, b, c = t
assert a > 0 and b... | 0 | 0 | 0 | 0 | 0 | 1,237 | 0 | -5 | 173 |
41ef00c687f4ea9fe746ec56e1be8278c6eb3bf9 | 1,064 | py | Python | ParProcCo/scheduler_mode_interface.py | DiamondLightSource/ParProcCo | 75742278f567a36e7bb74bb7c00f98407270a8ac | [
"BSD-3-Clause"
] | null | null | null | ParProcCo/scheduler_mode_interface.py | DiamondLightSource/ParProcCo | 75742278f567a36e7bb74bb7c00f98407270a8ac | [
"BSD-3-Clause"
] | 5 | 2021-09-07T15:02:49.000Z | 2022-03-17T20:43:00.000Z | ParProcCo/scheduler_mode_interface.py | DiamondLightSource/ParProcCo | 75742278f567a36e7bb74bb7c00f98407270a8ac | [
"BSD-3-Clause"
] | 1 | 2021-12-07T08:50:48.000Z | 2021-12-07T08:50:48.000Z | from __future__ import annotations
| 38 | 135 | 0.694549 | from __future__ import annotations
from datetime import datetime
from pathlib import Path
from typing import List, Optional, Tuple
class SchedulerModeInterface:
def __init__(self) -> None:
self.number_jobs: int
self.cores: int
self.program_path: Optional[Path]
self.allowed_module... | 0 | 0 | 0 | 908 | 0 | 0 | 0 | 30 | 90 |
15e31514a9fcc45da82364eec547a0384aec823d | 225 | py | Python | Problem_20/main.py | jdalzatec/EulerProject | 2f2f4d9c009be7fd63bb229bb437ea75db77d891 | [
"MIT"
] | 1 | 2022-03-28T05:32:58.000Z | 2022-03-28T05:32:58.000Z | Problem_20/main.py | jdalzatec/EulerProject | 2f2f4d9c009be7fd63bb229bb437ea75db77d891 | [
"MIT"
] | null | null | null | Problem_20/main.py | jdalzatec/EulerProject | 2f2f4d9c009be7fd63bb229bb437ea75db77d891 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main() | 18.75 | 59 | 0.635556 | from functools import reduce
from math import factorial
def main():
num = 100
value = factorial(num)
suma = reduce(lambda x, y: int(x) + int(y), str(value))
print(suma)
if __name__ == '__main__':
main() | 0 | 0 | 0 | 0 | 0 | 107 | 0 | 12 | 67 |
17b6282c7573cb41d82adbd3f2e2fcbdd8890ba2 | 6,462 | py | Python | source/services/lex-bot/other_intents/test_help_intent.py | s3799570/P000075CSITCP | dcf9f388a22baffc99e01b445e5d95089a896113 | [
"Apache-2.0"
] | 3 | 2021-10-30T12:53:47.000Z | 2022-02-09T06:33:08.000Z | source/services/lex-bot/other_intents/test_help_intent.py | s3799570/P000075CSITCP | dcf9f388a22baffc99e01b445e5d95089a896113 | [
"Apache-2.0"
] | 10 | 2021-12-20T17:41:54.000Z | 2022-02-27T10:33:23.000Z | source/services/lex-bot/other_intents/test_help_intent.py | s3799570/P000075CSITCP | dcf9f388a22baffc99e01b445e5d95089a896113 | [
"Apache-2.0"
] | 3 | 2021-10-30T12:53:42.000Z | 2022-03-21T08:18:47.000Z | ######################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 52.536585 | 191 | 0.50325 | ######################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 14 | 4,784 | 0 | 0 | 0 | 0 | 0 | -3 | 111 |
42ceed1a1a21505baf6adca410e9fdef4602f5b8 | 131,835 | py | Python | pareto/operational_water_management/operational_produced_water_optimization_model.py | ksbeattie/project-pareto | aafa060d938ff253691447c080d6727e3f719b36 | [
"BSD-3-Clause-LBNL"
] | 4 | 2022-01-28T17:39:33.000Z | 2022-02-25T20:15:53.000Z | pareto/operational_water_management/operational_produced_water_optimization_model.py | ksbeattie/project-pareto | aafa060d938ff253691447c080d6727e3f719b36 | [
"BSD-3-Clause-LBNL"
] | 24 | 2021-11-12T14:31:52.000Z | 2022-03-29T19:02:34.000Z | pareto/operational_water_management/operational_produced_water_optimization_model.py | ksbeattie/project-pareto | aafa060d938ff253691447c080d6727e3f719b36 | [
"BSD-3-Clause-LBNL"
] | 5 | 2021-11-10T15:27:16.000Z | 2022-02-25T16:53:38.000Z | #####################################################################################################
# PARETO was produced under the DOE Produced Water Application for Beneficial Reuse Environmental
# Impact and Treatment Optimization (PARETO), and is copyright (c) 2021 by the software owners: The
# Regents of the Uni... | 34.385759 | 152 | 0.520605 | #####################################################################################################
# PARETO was produced under the DOE Produced Water Application for Beneficial Reuse Environmental
# Impact and Treatment Optimization (PARETO), and is copyright (c) 2021 by the software owners: The
# Regents of the Uni... | 0 | 0 | 0 | 37 | 0 | 128,620 | 0 | 246 | 247 |
1becc35c1544729b291b76e5e1c8312395737ac8 | 8,641 | py | Python | get_ext_repo.py | natemellendorf/configpy | 750da5eaef33cede9f3ef532453d63e507f34a2c | [
"MIT"
] | 4 | 2020-01-20T06:46:33.000Z | 2021-07-28T21:53:29.000Z | get_ext_repo.py | natemellendorf/configpy | 750da5eaef33cede9f3ef532453d63e507f34a2c | [
"MIT"
] | 5 | 2020-03-24T17:00:44.000Z | 2021-12-13T19:59:01.000Z | get_ext_repo.py | natemellendorf/configpy | 750da5eaef33cede9f3ef532453d63e507f34a2c | [
"MIT"
] | null | null | null | from pprint import pprint
if __name__ == '__main__':
github = 'https://github.com/natemellendorf/tr_templates'
gitlab = 'http://gitlab/root/awesome'
test = get_ext_repo(gitlab)
pprint(test)
| 36.306723 | 121 | 0.490568 | import requests
from pprint import pprint
import redis
import json
from datetime import datetime
from config_snips import cluster_config
def current_time():
current_time = str(datetime.now().time())
no_sec = current_time.split('.')
time = no_sec.pop(0)
return time
def static_error(error):
new_dat... | 0 | 0 | 0 | 0 | 0 | 8,228 | 0 | 1 | 202 |
5b158e28007251306ff82f9b52ca056b2713569a | 15,114 | py | Python | valueIteration/value_iteration_4D.py | kensukenk/optimized_dp | 4771787366ca04139c168c8988dad378ad404ab6 | [
"MIT"
] | 41 | 2020-06-23T01:58:03.000Z | 2022-03-28T01:45:12.000Z | valueIteration/value_iteration_4D.py | kensukenk/optimized_dp | 4771787366ca04139c168c8988dad378ad404ab6 | [
"MIT"
] | 1 | 2021-08-01T06:58:57.000Z | 2021-08-01T06:58:57.000Z | valueIteration/value_iteration_4D.py | kensukenk/optimized_dp | 4771787366ca04139c168c8988dad378ad404ab6 | [
"MIT"
] | 20 | 2020-06-05T20:52:02.000Z | 2022-03-01T03:17:39.000Z |
######################################### HELPER FUNCTIONS #########################################
# Update the value function at position (i,j,k,l)
# iVals: holds index values (i,j,k,l) that correspond to state values (si,sj,sk,sl)
# intermeds: holds the estimated value associated with taking each action
# ... | 60.943548 | 173 | 0.494707 | import heterocl as hcl
import numpy as np
import time
import os
######################################### HELPER FUNCTIONS #########################################
# Update the value function at position (i,j,k,l)
# iVals: holds index values (i,j,k,l) that correspond to state values (si,sj,sk,sl)
# intermeds: ... | 0 | 0 | 0 | 0 | 0 | 13,675 | 0 | -24 | 222 |
e914cdbaf9db38c6a1e4d3a7709ce06b88ad5dcc | 957 | py | Python | blog/templatetags/blog_tags.py | Volodichev/Django | cebc9629987bc02067a1aa8d6e4ff901a24d1f98 | [
"MIT"
] | null | null | null | blog/templatetags/blog_tags.py | Volodichev/Django | cebc9629987bc02067a1aa8d6e4ff901a24d1f98 | [
"MIT"
] | null | null | null | blog/templatetags/blog_tags.py | Volodichev/Django | cebc9629987bc02067a1aa8d6e4ff901a24d1f98 | [
"MIT"
] | null | null | null | from django import template
from blog.models import Category
register = template.Library()
def get_categories(context, order, count):
""" """
# categories = Category.objects.filter(published=True, parent__isnull=True).order_by(order)
categories = Category.objects.filter(published=True).order_by(order)
... | 34.178571 | 95 | 0.746082 | from django import template
from blog.models import Category
register = template.Library()
def get_categories(context, order, count):
"""Получаю список категорий"""
# categories = Category.objects.filter(published=True, parent__isnull=True).order_by(order)
categories = Category.objects.filter(published=... | 124 | 439 | 0 | 0 | 0 | 0 | 0 | 0 | 46 |
8e7e0be8d21bf4d81ac8c4f4330098fdfbc73d8a | 774 | py | Python | 2017/day4/puzzle2.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | 2017/day4/puzzle2.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | 2017/day4/puzzle2.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# http://adventofcode.com/2017/day/4
import sys
if __name__ == '__main__':
main(sys.argv)
| 23.454545 | 66 | 0.590439 | #!/usr/bin/env python3
# http://adventofcode.com/2017/day/4
import sys
def load_passphrases(datafile):
with open(datafile, 'rb') as f:
return [line.decode('utf-8').strip('\n') for line in f]
def main(argv):
datafile = argv[1]
passphrases = load_passphrases(datafile)
valid = 0
invalid =... | 0 | 0 | 0 | 0 | 0 | 605 | 0 | 0 | 46 |
f679f0ada9270379bfe42846ba1ec73d464a78cf | 128 | py | Python | lifelist/api/admin.py | andela-mnzomo/life-list | 28a7fa9d16e2b322e4a1bce269dbe7331e783534 | [
"Unlicense"
] | 3 | 2017-08-17T07:12:03.000Z | 2017-10-18T11:13:44.000Z | lifelist/api/admin.py | andela-mnzomo/life-list | 28a7fa9d16e2b322e4a1bce269dbe7331e783534 | [
"Unlicense"
] | 1 | 2018-05-30T14:38:52.000Z | 2018-05-30T14:38:52.000Z | lifelist/api/admin.py | andela-mnzomo/life-list | 28a7fa9d16e2b322e4a1bce269dbe7331e783534 | [
"Unlicense"
] | null | null | null | from django.contrib import admin
from models import Bucketlist, Item
admin.site.register(Bucketlist)
admin.site.register(Item)
| 21.333333 | 35 | 0.828125 | from django.contrib import admin
from models import Bucketlist, Item
admin.site.register(Bucketlist)
admin.site.register(Item)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
59e10b8a316f3d2f6e6fe62963da3255be088523 | 1,690 | py | Python | setup.py | GrammaTech/gtirb-capstone | f46d90e9cd733c632620e5d8c921a4b9f011020a | [
"MIT"
] | 6 | 2020-04-10T15:19:30.000Z | 2021-04-13T22:54:17.000Z | setup.py | GrammaTech/gtirb-capstone | f46d90e9cd733c632620e5d8c921a4b9f011020a | [
"MIT"
] | null | null | null | setup.py | GrammaTech/gtirb-capstone | f46d90e9cd733c632620e5d8c921a4b9f011020a | [
"MIT"
] | 3 | 2020-07-10T22:52:32.000Z | 2021-02-13T19:52:22.000Z | #
# Copyright (C) 2020 GrammaTech, Inc.
#
# This code is licensed under the MIT license. See the LICENSE file in
# the project root for license terms.
#
# This project is sponsored by the Office of Naval Research, One Liberty
# Center, 875 N. Randolph Street, Arlington, VA 22203 under contract #
# N68335-17-C-0700. Th... | 30.178571 | 79 | 0.597041 | #
# Copyright (C) 2020 GrammaTech, Inc.
#
# This code is licensed under the MIT license. See the LICENSE file in
# the project root for license terms.
#
# This project is sponsored by the Office of Naval Research, One Liberty
# Center, 875 N. Randolph Street, Arlington, VA 22203 under contract #
# N68335-17-C-0700. Th... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4d1b9062f6dd748ffda8b31a1aceb57d2db1dec1 | 155 | py | Python | blogs/admin.py | AnkushCh/Finalproject | 880d29390043a506c8c4f570b8005b9f4660454b | [
"MIT"
] | 1 | 2020-12-01T09:59:21.000Z | 2020-12-01T09:59:21.000Z | blogs/admin.py | AnkushCh/Finalproject | 880d29390043a506c8c4f570b8005b9f4660454b | [
"MIT"
] | null | null | null | blogs/admin.py | AnkushCh/Finalproject | 880d29390043a506c8c4f570b8005b9f4660454b | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Post, Comments
# Register your models here.
admin.site.register(Post)
admin.site.register(Comments)
| 19.375 | 34 | 0.8 | from django.contrib import admin
from .models import Post, Comments
# Register your models here.
admin.site.register(Post)
admin.site.register(Comments)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
96bd8ee23bf397dd5607427f8c9e71c375b4e70e | 7,439 | py | Python | unitx/UnitXListener.py | 0ED/UnitX | f3c8c564cb7822cebb24ebc000ca454f3222fbf2 | [
"MIT"
] | 2 | 2016-03-13T08:35:58.000Z | 2016-03-13T19:20:07.000Z | unitx/UnitXListener.py | 0ED/UnitX | f3c8c564cb7822cebb24ebc000ca454f3222fbf2 | [
"MIT"
] | 1 | 2016-11-04T23:34:21.000Z | 2016-11-04T23:34:21.000Z | unitx/UnitXListener.py | supertask/UnitX | f3c8c564cb7822cebb24ebc000ca454f3222fbf2 | [
"MIT"
] | null | null | null | # Generated from UnitX.g4 by ANTLR 4.5.1
# This class defines a complete listener for a parse tree produced by UnitXParser.
| 25.216949 | 82 | 0.680737 | # Generated from UnitX.g4 by ANTLR 4.5.1
from antlr4 import *
# This class defines a complete listener for a parse tree produced by UnitXParser.
class UnitXListener(ParseTreeListener):
# Enter a parse tree produced by UnitXParser#program.
def enterProgram(self, ctx):
pass
# Exit a parse tree prod... | 0 | 0 | 0 | 7,269 | 0 | 0 | 0 | -1 | 44 |
8b466cd90199311e8b4ba4a9c518eb5896fa30b4 | 2,539 | py | Python | projeto-02/graph.py | henrique-tavares/IFB-Analise-de-Algoritmos | 36db7672fea45ce8ab9dce5bbe41aec30be18465 | [
"MIT"
] | null | null | null | projeto-02/graph.py | henrique-tavares/IFB-Analise-de-Algoritmos | 36db7672fea45ce8ab9dce5bbe41aec30be18465 | [
"MIT"
] | null | null | null | projeto-02/graph.py | henrique-tavares/IFB-Analise-de-Algoritmos | 36db7672fea45ce8ab9dce5bbe41aec30be18465 | [
"MIT"
] | 1 | 2021-07-15T23:50:37.000Z | 2021-07-15T23:50:37.000Z | from __future__ import annotations
if __name__ == "__main__":
# g = Graph.random_generator(10, 0.2)
# print(g)
# print(len(g["0"].values()))
for i in (0.25, 0.5, 1):
g = Graph.random_generator(10, i)
print(g, end="\n\n")
| 29.183908 | 93 | 0.590784 | from __future__ import annotations
from collections import defaultdict
from math import ceil
from typing import Dict, NamedTuple
from random import randint, sample
class Edge(NamedTuple):
vertice: str
distance: float
bidrectional: bool = False
class Graph:
def __init__(self) -> None:
self.el... | 0 | 1,005 | 0 | 1,100 | 0 | 0 | 0 | 41 | 134 |
369bbf3c6fcc3f3fa0a093ab85e4f12dd895b953 | 6,306 | py | Python | estar/src/moeadd/moeadd_ref/moeadd_supplementary.py | tatikhonova/FEDOT.Algs | aeb539f52bfbdb0ba8f4975e9ea7cb5a60859e25 | [
"BSD-3-Clause"
] | null | null | null | estar/src/moeadd/moeadd_ref/moeadd_supplementary.py | tatikhonova/FEDOT.Algs | aeb539f52bfbdb0ba8f4975e9ea7cb5a60859e25 | [
"BSD-3-Clause"
] | null | null | null | estar/src/moeadd/moeadd_ref/moeadd_supplementary.py | tatikhonova/FEDOT.Algs | aeb539f52bfbdb0ba8f4975e9ea7cb5a60859e25 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 30 14:04:57 2020
@author: mike_ubuntu
"""
| 42.897959 | 149 | 0.629718 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 30 14:04:57 2020
@author: mike_ubuntu
"""
from copy import deepcopy
import numpy as np
def check_dominance(target, compared_with) -> bool:
flag = False
for obj_fun_idx in range(len(target.obj_fun)):
if target.ob... | 180 | 0 | 0 | 590 | 0 | 5,197 | 0 | 1 | 270 |
43cf2550196fb601b5410a14ffba60cec95eaddd | 692 | py | Python | scripts/controller.py | kato-masahiro/raspimouse_maze_manual | e5b6317bbb889de416b52dc1a61790c9e235c084 | [
"BSD-3-Clause"
] | null | null | null | scripts/controller.py | kato-masahiro/raspimouse_maze_manual | e5b6317bbb889de416b52dc1a61790c9e235c084 | [
"BSD-3-Clause"
] | null | null | null | scripts/controller.py | kato-masahiro/raspimouse_maze_manual | e5b6317bbb889de416b52dc1a61790c9e235c084 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import rospy
if __name__ == '__main__':
rospy.init_node('joy_twist')
joy_twist = JoyTwist()
rospy.spin()
| 30.086957 | 87 | 0.643064 | #!/usr/bin/env python
import rospy
import math
from sensor_msgs.msg import Joy
from geometry_msgs.msg import Twist
class JoyTwist(object):
def __init__(self):
self._joy_sub = rospy.Subscriber('joy', Joy, self.joy_callback, queue_size = 1)
self._twist_pub = rospy.Publisher('/cmd_vel', Twist, queue_s... | 0 | 0 | 0 | 449 | 0 | 0 | 0 | 14 | 89 |
974da76cfbed60fb31e44aeefba7b8b79a4e2ee8 | 719 | py | Python | py/day07.py | kwinkunks/aoc21 | 4fccd605334ad55b6ddc34bdd1921b1d42fc8a42 | [
"Apache-2.0"
] | null | null | null | py/day07.py | kwinkunks/aoc21 | 4fccd605334ad55b6ddc34bdd1921b1d42fc8a42 | [
"Apache-2.0"
] | null | null | null | py/day07.py | kwinkunks/aoc21 | 4fccd605334ad55b6ddc34bdd1921b1d42fc8a42 | [
"Apache-2.0"
] | null | null | null |
if __name__ == "__main__":
# Part 1.
assert part1(get_data(7, 'test')) == 37, "Part 1 failed."
print(f"Part 1: {part1(get_data(7, 'data')):.0f}")
# Part 2.
assert part2(get_data(7, 'test')) == 168, "Part 2 failed."
print(f"Part 2: {part2(get_data(7, 'data')):.0f}")
| 27.653846 | 62 | 0.588317 | import numpy as np
def get_data(day, dataset):
with open(f'../js/day{day:02d}/{dataset}.txt', 'r') as f:
return np.array(list(map(int, f.read().split(','))))
def part1(data):
return np.abs(data - np.median(data)).sum()
def part2(data):
points = np.arange(2000).reshape(-1, 1)
dists = np.abs(np... | 0 | 0 | 0 | 0 | 0 | 337 | 0 | -3 | 91 |
3ff95edb9cad1101f186963ca13d6372c9ea44db | 1,193 | py | Python | demo_wait.py | rdagger/micropython-ads1220 | c90f939517c8163b234210b8cf91b3ce948b5b1c | [
"MIT"
] | 2 | 2021-08-25T11:40:23.000Z | 2022-02-28T05:31:18.000Z | demo_wait.py | rdagger/micropython-ads1220 | c90f939517c8163b234210b8cf91b3ce948b5b1c | [
"MIT"
] | null | null | null | demo_wait.py | rdagger/micropython-ads1220 | c90f939517c8163b234210b8cf91b3ce948b5b1c | [
"MIT"
] | 1 | 2021-08-08T11:39:47.000Z | 2021-08-08T11:39:47.000Z | """ADS1220 example (polling ADC).
Uses single shot mode and wait for data ready."""
from time import sleep
from machine import Pin, SPI # type: ignore
from ads1220 import ADC
cs = 15 # Chip select pin
drdy = 27 # Data ready pin
spi = SPI(1,
baudrate=10000000, # 10 MHz (try lower speed to troubleshoot)... | 28.404762 | 74 | 0.600168 | """ADS1220 example (polling ADC).
Uses single shot mode and wait for data ready."""
from time import sleep
from machine import Pin, SPI # type: ignore
from ads1220 import ADC
cs = 15 # Chip select pin
drdy = 27 # Data ready pin
spi = SPI(1,
baudrate=10000000, # 10 MHz (try lower speed to troubleshoot)... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4cf5ed14c9a66510d6acd4017cb1faca8edf5750 | 2,265 | py | Python | tfx_addons/feast_examplegen/component_test.py | BACtaki/tfx-addons | 130465c2cdaae45728535ea09e4bf38f4ca9eb38 | [
"Apache-2.0"
] | 1 | 2021-07-10T00:25:06.000Z | 2021-07-10T00:25:06.000Z | tfx_addons/feast_examplegen/component_test.py | BACtaki/tfx-addons | 130465c2cdaae45728535ea09e4bf38f4ca9eb38 | [
"Apache-2.0"
] | 4 | 2021-11-13T03:10:19.000Z | 2022-02-18T19:00:47.000Z | tfx_addons/feast_examplegen/component_test.py | BACtaki/tfx-addons | 130465c2cdaae45728535ea09e4bf38f4ca9eb38 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 37.75 | 80 | 0.647241 | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 0 | 0 | 0 | 0 | 0 | 1,246 | 0 | 44 | 116 |
e19d19ef0a9751a966e5539a1d4f246e5698feea | 10,309 | py | Python | tools/apollo4b_scripts/am_defines.py | vaxradius/Apollo4B-SDK-2021.02.08 | 507e328b16a179f5d5b18685d5be4a5c6753f852 | [
"BSD-3-Clause"
] | 2 | 2021-11-04T03:48:20.000Z | 2021-12-27T01:34:31.000Z | tools/apollo4b_scripts/am_defines.py | vaxradius/Apollo4B-SDK-2021.02.08 | 507e328b16a179f5d5b18685d5be4a5c6753f852 | [
"BSD-3-Clause"
] | null | null | null | tools/apollo4b_scripts/am_defines.py | vaxradius/Apollo4B-SDK-2021.02.08 | 507e328b16a179f5d5b18685d5be4a5c6753f852 | [
"BSD-3-Clause"
] | 2 | 2021-11-04T03:47:21.000Z | 2021-12-27T01:30:28.000Z | #!/usr/bin/env python3
# Utility functioins
MAX_DOWNLOAD_SIZE = 0x48000 # 288K
AM_SECBOOT_DEFAULT_NONSECURE_MAIN = 0x18000
# Encryption Algorithm
# String constants
# Authentication Algorithm
FLASH_INVALID = 0xFFFFFFFF
# KeyWrap Mode
#**************************************... | 34.135762 | 112 | 0.484237 | #!/usr/bin/env python3
# Utility functioins
import sys
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Signature import pss
from Crypto.Hash import SHA256
import array
import hashlib
import hmac
import os
import binascii
MAX_DOWNLOAD_SIZE = ... | 0 | 0 | 0 | 0 | 0 | 2,967 | 0 | 2 | 575 |
f72fef007e9ec6112672dfd0e87b7ec609049c6a | 2,115 | py | Python | scrape_artists/artists.py | flannerykj/python_scrape | c5166431810432c24e04150eb305b3ec2a899a91 | [
"MIT"
] | null | null | null | scrape_artists/artists.py | flannerykj/python_scrape | c5166431810432c24e04150eb305b3ec2a899a91 | [
"MIT"
] | null | null | null | scrape_artists/artists.py | flannerykj/python_scrape | c5166431810432c24e04150eb305b3ec2a899a91 | [
"MIT"
] | null | null | null | import json
with open('artists.json', 'w') as outfile:
json.dump(parse_artists(), outfile)
'''artist_urls = get_artist_urls()
artist_array = compile_artist_profiles(artist_urls)
outfile = open("./toronto-artists.csv", "wb")
writer = csv.writer(outfile)
writer.writerows(recipe_array)'''
| 33.571429 | 144 | 0.605674 |
import csv
import requests
import socket
from bs4 import BeautifulSoup
import re
import json
def parse_artists():
artist_profiles = []
try:
url = 'http://wx.toronto.ca/inter/pmmd/streetart.nsf/artists?OpenView'
response = requests.get(url)
html = response.content
soup = Beautif... | 0 | 0 | 0 | 0 | 0 | 1,692 | 0 | -29 | 157 |
6b4633f252cbbf76f44dce400dc91c131a603c52 | 22,669 | py | Python | pgcli/packages/sqlcompletion.py | akshay-joshi/pgcli | 51c4cf495cab0722f0f474dceb502746e8e7c5ed | [
"BSD-3-Clause"
] | null | null | null | pgcli/packages/sqlcompletion.py | akshay-joshi/pgcli | 51c4cf495cab0722f0f474dceb502746e8e7c5ed | [
"BSD-3-Clause"
] | null | null | null | pgcli/packages/sqlcompletion.py | akshay-joshi/pgcli | 51c4cf495cab0722f0f474dceb502746e8e7c5ed | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
import sys
import re
from collections import namedtuple
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY3:
string_types = str
else:
string_types = basestring
Special = namedtuple('Special', [])
Database = namedtuple('Database', [])
Schema = namedtuple... | 38.357022 | 79 | 0.619613 | from __future__ import print_function
import sys
import re
import sqlparse
from collections import namedtuple
from sqlparse.sql import Comparison, Identifier, Where
from .parseutils.utils import (
last_word, find_prev_keyword, parse_partial_identifier)
from .parseutils.tables import extract_tables
from .parseutils.... | 0 | 0 | 0 | 3,141 | 0 | 14,130 | 0 | 174 | 270 |
0b00751199a21103bbd2d9de1bbc3315e858f87a | 2,476 | py | Python | switch_inputs/bioenergy_clean.py | Switch-Mexico/switch-inputs | e2afa96c40b516435c350d525119e4594f1b7eca | [
"MIT"
] | 1 | 2020-07-14T21:50:28.000Z | 2020-07-14T21:50:28.000Z | switch_inputs/bioenergy_clean.py | Switch-Mexico/switch-inputs | e2afa96c40b516435c350d525119e4594f1b7eca | [
"MIT"
] | 14 | 2018-12-14T23:21:09.000Z | 2019-05-10T21:42:36.000Z | switch_inputs/bioenergy_clean.py | Switch-Mexico/switch-inputs | e2afa96c40b516435c350d525119e4594f1b7eca | [
"MIT"
] | 1 | 2020-07-14T21:50:37.000Z | 2020-07-14T21:50:37.000Z | """
Clean bioenergy data from AZEL
"""
import os
import json
import itertools
import geopandas as gpd
os.makedirs('data', exist_ok=True)
projection = 'epsg:4326'
name = ['pecuarios', 'forestales', 'industriales', 'urbanos']
scenario = ['E3', 'E1']
for scenario, name in itertools.product(scenario, name):
# Lo... | 38.6875 | 82 | 0.550485 | """
Clean bioenergy data from AZEL
"""
import os
import json
import itertools
import geopandas as gpd
import pandas as pd
os.makedirs('data', exist_ok=True)
projection = 'epsg:4326'
name = ['pecuarios', 'forestales', 'industriales', 'urbanos']
scenario = ['E3', 'E1']
for scenario, name in itertools.product(scena... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 22 |
1e25f3f0b115342908828bb75c9bb105ab2844b3 | 1,720 | py | Python | bounds/essentials.py | rkirov/code_bounds | 2855c3bfd2972c98d93b891c4f737b6f320c2664 | [
"Unlicense"
] | null | null | null | bounds/essentials.py | rkirov/code_bounds | 2855c3bfd2972c98d93b891c4f737b6f320c2664 | [
"Unlicense"
] | null | null | null | bounds/essentials.py | rkirov/code_bounds | 2855c3bfd2972c98d93b891c4f737b6f320c2664 | [
"Unlicense"
] | null | null | null |
#the table should be read T[deg][a] where a is the multiplicity of the Q
def build1DCeilingTable(c):
'''entry for A is max k s.t. l(A) = l(A+kP) and l(A+kQ) '''
max_deg = [0 for _ in range(c.m)]
CLP = c.fill_degree_table_reverse(update, max_deg)
CLQ = c.fill_degree_table_reverse(update, max_deg)
re... | 38.222222 | 74 | 0.629651 | def l_values(c):
minus_one_deg = [0 for _ in range(c.m)]
def update(div, minus_p_val, minus_q_val):
return minus_p_val + div.is_P_nongap()
lval = c.fill_degree_table(update, minus_one_deg)
return ['LVAL'], [lval]
def build_floor_table(c):
#if l(D) = 0, floor is assigned to be [0,1], XXX: w... | 0 | 0 | 0 | 0 | 0 | 1,248 | 0 | 0 | 122 |
47a1ef61a50d752f006c753ce45eb846e946bcb9 | 1,850 | py | Python | DSM/estrutura_dados/Entregas/PROVA SUBSTITUTIVA/exclusao.py | murillotlopes/DSM-Python | 2822b9b1b988936ab098c7052180ee3c3d7dd735 | [
"MIT"
] | null | null | null | DSM/estrutura_dados/Entregas/PROVA SUBSTITUTIVA/exclusao.py | murillotlopes/DSM-Python | 2822b9b1b988936ab098c7052180ee3c3d7dd735 | [
"MIT"
] | null | null | null | DSM/estrutura_dados/Entregas/PROVA SUBSTITUTIVA/exclusao.py | murillotlopes/DSM-Python | 2822b9b1b988936ab098c7052180ee3c3d7dd735 | [
"MIT"
] | null | null | null | # 1. Observe os dois mtodos de excluso listados abaixo.
#
# 2. Identifique a quais estruturas pertencem os mtodos, respectivamente.
# R: A primeira Lista duplamente encadeada (double_linked), metodo de remoo. A segunda Lista encadeada, metodo de remoo
#
# 3. Explique qual a diferena FUNDAMENTAL entre os dois mt... | 33.636364 | 302 | 0.648649 | # 1. Observe os dois métodos de exclusão listados abaixo.
#
# 2. Identifique a quais estruturas pertencem os métodos, respectivamente.
# R: A primeira é Lista duplamente encadeada (double_linked), metodo de remoção. A segunda é Lista encadeada, metodo de remoção
#
# 3. Explique qual a diferença FUNDAMENTAL entre ... | 40 | 0 | 0 | 0 | 0 | 1,140 | 0 | 0 | 44 |
728ed67c9adf8bf2a90007fb924fb783092d33e8 | 9,864 | py | Python | invenio_rest/csrf.py | max-moser/invenio-rest | 1b6bd04c953b0e9662314d5ee9601e966196f332 | [
"MIT"
] | null | null | null | invenio_rest/csrf.py | max-moser/invenio-rest | 1b6bd04c953b0e9662314d5ee9601e966196f332 | [
"MIT"
] | null | null | null | invenio_rest/csrf.py | max-moser/invenio-rest | 1b6bd04c953b0e9662314d5ee9601e966196f332 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2020 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""CSRF Middleware.
The implementation is highly inspred from Django's initial implementa... | 32.662252 | 79 | 0.662612 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2020 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""CSRF Middleware.
The implementation is highly inspred from Django's initial implementa... | 0 | 1,203 | 0 | 2,983 | 0 | 2,178 | 0 | 77 | 364 |
152b6caaa0f282aa664a559068342555529558dd | 978 | py | Python | sites/web/web/migrations/0005_auto_20210117_1826.py | PrathameshBolade/yats | 93bb5271255120b7131a3bc416e3386428a4d3ec | [
"MIT"
] | 54 | 2015-01-26T07:56:59.000Z | 2022-03-10T18:48:05.000Z | sites/web/web/migrations/0005_auto_20210117_1826.py | PrathameshBolade/yats | 93bb5271255120b7131a3bc416e3386428a4d3ec | [
"MIT"
] | 8 | 2015-03-15T18:33:39.000Z | 2021-12-21T14:23:11.000Z | sites/web/web/migrations/0005_auto_20210117_1826.py | PrathameshBolade/yats | 93bb5271255120b7131a3bc416e3386428a4d3ec | [
"MIT"
] | 23 | 2015-02-19T16:55:35.000Z | 2022-03-11T19:49:06.000Z | # Generated by Django 2.2.10 on 2021-01-17 17:26
| 33.724138 | 169 | 0.610429 | # Generated by Django 2.2.10 on 2021-01-17 17:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0004_auto_20180911_1440'),
]
operations = [
migrations.AlterField(
model_name='test',
name='billing_type',
... | 0 | 0 | 0 | 863 | 0 | 0 | 0 | 19 | 46 |
4fd3ea83be0511369dac144b43bafc6128ea8267 | 4,873 | py | Python | src/beast.py | yotamfr/skempi | 9e5dbb7661a36c973edb0e94cf8bfe843f839e66 | [
"MIT"
] | 1 | 2021-11-08T14:16:40.000Z | 2021-11-08T14:16:40.000Z | src/beast.py | yotamfr/skempi | 9e5dbb7661a36c973edb0e94cf8bfe843f839e66 | [
"MIT"
] | 16 | 2019-12-16T21:16:26.000Z | 2022-03-11T23:33:34.000Z | src/beast.py | yotamfr/skempi | 9e5dbb7661a36c973edb0e94cf8bfe843f839e66 | [
"MIT"
] | null | null | null | import torch
from torch import optim
BATCH_SIZE = 32
LR = 1e-3
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
add_arguments(parser)
args = parser.parse_args()
net = VAE2(nc=24, ngf=64, ndf=64, latent_variable_size=256)
net.to(device)
# opt = optim.SGD... | 34.316901 | 102 | 0.601683 | import torch
from torch import nn
from torch import optim
from vae import *
from loader import *
from skempi_lib import *
from torch_utils import *
BATCH_SIZE = 32
LR = 1e-3
def get_loss(aa_hat, aa, x_hat, x, mu, logvar):
KLD = -0.5 * torch.sum(1 + logvar - mu.pow(2) - logvar.exp())
L1 = nn.L1Loss(reduction... | 0 | 0 | 0 | 0 | 0 | 2,826 | 0 | 1 | 226 |
e5c1d44e5f230d87e88a537feae2bd6b367c70b9 | 898 | py | Python | scripts/query_all_orders.py | egorsimchuk/binance_bot | af1caac32f8d4804aea3af83250fd4530d9787df | [
"Unlicense"
] | 1 | 2022-03-13T01:07:08.000Z | 2022-03-13T01:07:08.000Z | scripts/query_all_orders.py | egorsimchuk/binance_bot | af1caac32f8d4804aea3af83250fd4530d9787df | [
"Unlicense"
] | 4 | 2022-02-20T10:33:45.000Z | 2022-03-03T22:59:24.000Z | scripts/query_all_orders.py | egorsimchuk/binance_bot | af1caac32f8d4804aea3af83250fd4530d9787df | [
"Unlicense"
] | null | null | null | import argparse
from src.client.client import ClientHelper
import logging
from src.data.orders_handler import load_and_process
from src.data.preprocessing.orders import OrdersProcessor
from src.utils.logging import log_format, log_level
logging.basicConfig(format=log_format, level=log_level)
if __name__ == '__main__... | 42.761905 | 123 | 0.77951 | import argparse
from src.client.client import ClientHelper
import logging
from src.data.orders_handler import load_and_process
from src.data.preprocessing.orders import OrdersProcessor
from src.utils.logging import log_format, log_level
logging.basicConfig(format=log_format, level=log_level)
if __name__ == '__main__... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d69331e986956345298d242355aaa1cd0eefe66f | 138 | py | Python | day13/aoc-day13.py | SebastiaanZ/aoc-2018 | fb4d6db2ed592fa17554c80531384afdc0c34180 | [
"MIT"
] | 1 | 2019-03-16T19:20:11.000Z | 2019-03-16T19:20:11.000Z | day13/aoc-day13.py | SebastiaanZ/aoc-2018 | fb4d6db2ed592fa17554c80531384afdc0c34180 | [
"MIT"
] | null | null | null | day13/aoc-day13.py | SebastiaanZ/aoc-2018 | fb4d6db2ed592fa17554c80531384afdc0c34180 | [
"MIT"
] | null | null | null | from railroads import Track
track = Track("day13-input.txt")
track.run_partone()
track2 = Track("day13-input.txt")
track2.run_parttwo()
| 17.25 | 33 | 0.753623 | from railroads import Track
track = Track("day13-input.txt")
track.run_partone()
track2 = Track("day13-input.txt")
track2.run_parttwo()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ac305c92f5ce9e62d182f5076f44c90f41ffa6af | 4,339 | py | Python | side_projects/extract_chr16_cpg/extract_location_and_context_to_csv.py | methylgrammarlab/proj_scwgbs | 287196898796eb617fef273bfaf9e978a57047dc | [
"MIT"
] | null | null | null | side_projects/extract_chr16_cpg/extract_location_and_context_to_csv.py | methylgrammarlab/proj_scwgbs | 287196898796eb617fef273bfaf9e978a57047dc | [
"MIT"
] | null | null | null | side_projects/extract_chr16_cpg/extract_location_and_context_to_csv.py | methylgrammarlab/proj_scwgbs | 287196898796eb617fef273bfaf9e978a57047dc | [
"MIT"
] | null | null | null | """
Extract information about chr16 for several patients for ben
"""
import pandas as pd
crc01_path = r"H:\Study\university\Computational-Biology\Year " \
r"3\Projects\proj_scwgbs\resource\cpg_format\filtered_by_bl_and_cpgi\CRC01\all_cpg_ratios_CRC01_chr16.dummy.pkl.zip"
crc11_path = r"H:\Study\universit... | 41.721154 | 129 | 0.690943 | """
Extract information about chr16 for several patients for ben
"""
import pandas as pd
crc01_path = r"H:\Study\university\Computational-Biology\Year " \
r"3\Projects\proj_scwgbs\resource\cpg_format\filtered_by_bl_and_cpgi\CRC01\all_cpg_ratios_CRC01_chr16.dummy.pkl.zip"
crc11_path = r"H:\Study\universit... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
59e12014ee9c4a44c159a0e0cd44aac722333c28 | 1,509 | py | Python | setup.py | SUNET/eduid-queue | e7d090978220a4beaf61e5d893233120d8e79cdd | [
"BSD-2-Clause"
] | null | null | null | setup.py | SUNET/eduid-queue | e7d090978220a4beaf61e5d893233120d8e79cdd | [
"BSD-2-Clause"
] | null | null | null | setup.py | SUNET/eduid-queue | e7d090978220a4beaf61e5d893233120d8e79cdd | [
"BSD-2-Clause"
] | null | null | null | from pathlib import PurePath
from typing import List
from setuptools import find_packages, setup
version = '0.0.4'
def load_requirements(path: PurePath) -> List[str]:
""" Load dependencies from a requirements.txt style file, ignoring comments etc. """
res = []
with open(path) as fd:
for line in ... | 31.4375 | 98 | 0.648774 | from pathlib import PurePath
from typing import List
from setuptools import find_packages, setup
version = '0.0.4'
def load_requirements(path: PurePath) -> List[str]:
""" Load dependencies from a requirements.txt style file, ignoring comments etc. """
res = []
with open(path) as fd:
for line in ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
939dd53c6999e793bc3ce2b6e8b9689a8b6c18aa | 3,451 | py | Python | fft_fluid_solver.py | 0xrabbyte/taichi_simple_fluid_solver | 992924edeee66a74e747b4503fa381637eabf03f | [
"MIT"
] | 3 | 2021-12-16T04:58:13.000Z | 2021-12-21T12:43:31.000Z | fft_fluid_solver.py | 0xrabbyte/taichi_simple_fluid_solver | 992924edeee66a74e747b4503fa381637eabf03f | [
"MIT"
] | null | null | null | fft_fluid_solver.py | 0xrabbyte/taichi_simple_fluid_solver | 992924edeee66a74e747b4503fa381637eabf03f | [
"MIT"
] | null | null | null | import taichi as ti
lin_iters = 20
N = 64
dt = 0.1
diff = 0.0
visc = 0.0
force = 5e5
source = 100.0
dvel = False
v = ti.Vector.field(2, float, shape=(N + 2, N + 2), offset = (-1, -1))
v_prev = ti.Vector.field(2, float, shape=(N + 2, N + 2), offset = (-1, -1))
dens = ti.field(float, shape=(N + 2, N + ... | 31.372727 | 102 | 0.454361 | from numpy.core.fromnumeric import shape
import taichi as ti
import numpy as np
lin_iters = 20
N = 64
dt = 0.1
diff = 0.0
visc = 0.0
force = 5e5
source = 100.0
dvel = False
v = ti.Vector.field(2, float, shape=(N + 2, N + 2), offset = (-1, -1))
v_prev = ti.Vector.field(2, float, shape=(N + 2, N + 2),... | 0 | 1,326 | 0 | 0 | 0 | 1,258 | 0 | 16 | 270 |
0a242dfa84979d870503e1a938700b15f2f94260 | 1,000 | py | Python | helpers/populate_zones.py | qbrc-cnap/cnap | 624683e91a64c3b4934b578c59db850242d2f94c | [
"MIT"
] | 1 | 2021-07-08T14:06:04.000Z | 2021-07-08T14:06:04.000Z | helpers/populate_zones.py | qbrc-cnap/cnap | 624683e91a64c3b4934b578c59db850242d2f94c | [
"MIT"
] | 12 | 2020-02-12T00:10:53.000Z | 2021-06-10T21:24:45.000Z | helpers/populate_zones.py | qbrc-cnap/cnap | 624683e91a64c3b4934b578c59db850242d2f94c | [
"MIT"
] | null | null | null | import sys
import os
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.realpath(os.pardir))
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cnap_v2.settings')
import django
from django.conf import settings
django.setup()
from base.models import AvailableZones, CurrentZone
if __name__ =... | 33.333333 | 88 | 0.708 | import sys
import os
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.realpath(os.pardir))
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cnap_v2.settings')
import django
from django.conf import settings
django.setup()
from base.models import AvailableZones, CurrentZone
if __name__ =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5223cec5815747015e2cf337d69de35d96fdb7b8 | 2,129 | py | Python | household/migrations/0002_auto_20200303_1532.py | desafinadude/municipal-data | 1c86c55bbb59f9c8087f6920fae3585dd90d5d43 | [
"MIT"
] | 19 | 2018-01-09T10:54:15.000Z | 2022-01-25T13:10:55.000Z | household/migrations/0002_auto_20200303_1532.py | desafinadude/municipal-data | 1c86c55bbb59f9c8087f6920fae3585dd90d5d43 | [
"MIT"
] | 29 | 2018-01-12T12:12:38.000Z | 2022-01-31T15:30:36.000Z | household/migrations/0002_auto_20200303_1532.py | desafinadude/municipal-data | 1c86c55bbb59f9c8087f6920fae3585dd90d5d43 | [
"MIT"
] | 13 | 2018-02-11T02:12:57.000Z | 2021-11-22T11:03:22.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2020-03-03 13:32
from __future__ import unicode_literals
| 41.745098 | 70 | 0.753405 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2020-03-03 13:32
from __future__ import unicode_literals
from django.db import migrations
def add_financial_year(apps, schema_editor):
FinancialYear = apps.get_model('household', 'FinancialYear')
FinancialYear.objects.create(budget_year="2015/2016")
... | 0 | 0 | 0 | 290 | 0 | 1,576 | 0 | 11 | 138 |
c28dee9c33942755f7781bf26747522afc2dd87d | 529 | py | Python | code-everyday-challenge/n62_the_king.py | ved93/deliberate-practice-challenges | 2fccdbb9d2baaa16f888055c081a8d04804c0045 | [
"MIT"
] | null | null | null | code-everyday-challenge/n62_the_king.py | ved93/deliberate-practice-challenges | 2fccdbb9d2baaa16f888055c081a8d04804c0045 | [
"MIT"
] | null | null | null | code-everyday-challenge/n62_the_king.py | ved93/deliberate-practice-challenges | 2fccdbb9d2baaa16f888055c081a8d04804c0045 | [
"MIT"
] | null | null | null |
#https://www.geeksforgeeks.org/puzzle-maximum-number-kings-chessboard-without-check/
if __name__ == '__main__':
print(main(9,3)) | 15.558824 | 84 | 0.449905 |
#https://www.geeksforgeeks.org/puzzle-maximum-number-kings-chessboard-without-check/
def main(l,w):
l, w = max(l,w), min(w,l)
result = 0
count = 0
mn=min(l // 3,w//3)
count += mn*8
bl = l%3
if bl == 2:
count += (w//3)*5
count+=(w%3)*2-1
if bl == 1:
count += ... | 0 | 0 | 0 | 0 | 0 | 366 | 0 | 0 | 22 |
a7287aeae17119d193ebe8345b7de35f2d5dd0af | 333 | py | Python | testapp/wagtail_wordpress_importer/migrations/0042_delete_customfieldsgrouplocation.py | nickmoreton/wagtail_wordpress_importer | fbe6b60ae624edac3f42a62ce30af4a0c548b4ed | [
"MIT"
] | null | null | null | testapp/wagtail_wordpress_importer/migrations/0042_delete_customfieldsgrouplocation.py | nickmoreton/wagtail_wordpress_importer | fbe6b60ae624edac3f42a62ce30af4a0c548b4ed | [
"MIT"
] | null | null | null | testapp/wagtail_wordpress_importer/migrations/0042_delete_customfieldsgrouplocation.py | nickmoreton/wagtail_wordpress_importer | fbe6b60ae624edac3f42a62ce30af4a0c548b4ed | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-01-10 21:41
| 19.588235 | 66 | 0.648649 | # Generated by Django 3.1.4 on 2021-01-10 21:41
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wagtail_wordpress_importer', '0041_auto_20210110_0628'),
]
operations = [
migrations.DeleteModel(
name='CustomFieldsGroupLocation',
... | 0 | 0 | 0 | 227 | 0 | 0 | 0 | 11 | 46 |
8aff30b1325031846426585dc6e6d56c20755efe | 1,601 | py | Python | systraymgr.py | DawningW/My-Minisite-Server | 3a44656d24cf91e7d2706aea289217a903e109f3 | [
"MIT"
] | 1 | 2020-02-21T15:56:54.000Z | 2020-02-21T15:56:54.000Z | systraymgr.py | DawningW/My-Minisite-Server | 3a44656d24cf91e7d2706aea289217a903e109f3 | [
"MIT"
] | 1 | 2020-02-10T07:15:39.000Z | 2020-02-10T07:15:39.000Z | systraymgr.py | DawningW/My-Minisite-Server | 3a44656d24cf91e7d2706aea289217a903e109f3 | [
"MIT"
] | null | null | null | # coding=utf-8
import os
import threading
import logging
import utils
if utils.getSystem() == utils.System.WINDOWS:
from SysTrayIcon import SysTrayIcon
trayThread = None
tray = None
show = True
def initTray():
""
logging.info("Start a new thread to manage system tray.")
global trayThread
trayThre... | 24.257576 | 87 | 0.632105 | # coding=utf-8
import os
import threading
import logging
import utils
if utils.getSystem() == utils.System.WINDOWS:
from SysTrayIcon import SysTrayIcon
trayThread = None
tray = None
show = True
def initTray():
"初始化系统托盘线程"
logging.info("Start a new thread to manage system tray.")
global trayThread
... | 177 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
07bcdf98fadb839414b17802415bfa04081f4e76 | 315 | py | Python | 0072 Invert Tree.py | ansabgillani/binarysearchcomproblems | 12fe8632f8cbb5058c91a55bae53afa813a3247e | [
"MIT"
] | 1 | 2020-12-29T21:17:26.000Z | 2020-12-29T21:17:26.000Z | 0072 Invert Tree.py | ansabgillani/binarysearchcomproblems | 12fe8632f8cbb5058c91a55bae53afa813a3247e | [
"MIT"
] | null | null | null | 0072 Invert Tree.py | ansabgillani/binarysearchcomproblems | 12fe8632f8cbb5058c91a55bae53afa813a3247e | [
"MIT"
] | 4 | 2021-09-09T17:42:43.000Z | 2022-03-18T04:54:03.000Z | # class Tree:
# def __init__(self, val, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
| 28.636364 | 81 | 0.561905 | # class Tree:
# def __init__(self, val, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def solve(self, root):
if root:
root.left, root.right = self.solve(root.right), self.solve(root.left)
return root
| 0 | 0 | 0 | 144 | 0 | 0 | 0 | 0 | 22 |
b41bd65de72b54228d27b15eb7cb53acfa278bd8 | 8,458 | py | Python | rflow/command.py | otaviog/rflow | 8594b9c3e9e1da61382f80b66e749cf7b8a33676 | [
"MIT"
] | 6 | 2019-08-26T11:36:58.000Z | 2020-12-15T21:01:24.000Z | rflow/command.py | otaviog/rflow | 8594b9c3e9e1da61382f80b66e749cf7b8a33676 | [
"MIT"
] | null | null | null | rflow/command.py | otaviog/rflow | 8594b9c3e9e1da61382f80b66e749cf7b8a33676 | [
"MIT"
] | 1 | 2020-04-13T08:05:27.000Z | 2020-04-13T08:05:27.000Z | """Command-line interfacing workflows"""
import argparse
import os
import sys
import argcomplete
from . import core
from . common import WorkflowError, WORKFLOW_DEFAULT_FILENAME
from . userargument import USER_ARGS_CONTEXT
from . _ui import ui
def open_graph(directory, graph_name, wf_filename=WORKFLOW_DEFAULT... | 28.478114 | 95 | 0.657011 | """Command-line interfacing workflows"""
import argparse
import os
import sys
import imp
import inspect
import argcomplete
from . import core
from . common import WorkflowError, WORKFLOW_DEFAULT_FILENAME
from . import decorators
from . userargument import USER_ARGS_CONTEXT
from . _ui import ui
from . import _util a... | 0 | 0 | 0 | 164 | 0 | 3,840 | 0 | -9 | 295 |
d17c1ec8c4e434997012bd6fecb4cf01d7f5f931 | 1,965 | py | Python | catkin_ws/src/wheel_odom/src/read_encoder.py | AndySer37/duckietown_text | cc7ae0d48c182c991a2afa67bf40d3f0f0e5cd49 | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src/wheel_odom/src/read_encoder.py | AndySer37/duckietown_text | cc7ae0d48c182c991a2afa67bf40d3f0f0e5cd49 | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src/wheel_odom/src/read_encoder.py | AndySer37/duckietown_text | cc7ae0d48c182c991a2afa67bf40d3f0f0e5cd49 | [
"CC-BY-2.0"
] | null | null | null | #!/usr/bin/env python
import rospy
import tf
import serial
global x, y, theta, v_L, v_R, v_x, v_y, omega
x = 0
y = 0
theta = 0
v_L = 0
v_R = 0
v_x = 0
v_y = 0
omega = 0
pub_tf = False # Use estimate result as tf
if(pub_tf):
br = tf.TransformBroadcaster()
if __name__ == '__main__':
rospy.init_node('whel_odom_node', ... | 26.554054 | 77 | 0.680916 | #!/usr/bin/env python
import rospy
import tf
import serial
import numpy as np
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Point
from std_msgs.msg import Int64
global x, y, theta, v_L, v_R, v_x, v_y, omega
x = 0
y = 0
theta = 0
v_L = 0
v_R = 0
v_x = 0
v_y = 0
omega = 0
pub_tf = False # Use estimate ... | 0 | 0 | 0 | 0 | 0 | 1,297 | 0 | 32 | 111 |
e2b0eb16ff59352823b96b85f477cffe67241cc6 | 309 | py | Python | umich-notebook/global_nbgrader_config.py | IllumiDesk/umich-stacks | 92161237f9031ee7e7689fd7b1177c2b5271560a | [
"MIT"
] | 1 | 2021-11-09T20:59:00.000Z | 2021-11-09T20:59:00.000Z | umich-notebook/global_nbgrader_config.py | IllumiDesk/umich-stacks | 92161237f9031ee7e7689fd7b1177c2b5271560a | [
"MIT"
] | 2 | 2021-08-07T04:01:16.000Z | 2021-08-08T00:18:25.000Z | umich-notebook/global_nbgrader_config.py | IllumiDesk/umich-stacks | 92161237f9031ee7e7689fd7b1177c2b5271560a | [
"MIT"
] | 1 | 2020-11-09T02:06:41.000Z | 2020-11-09T02:06:41.000Z | from nbgrader.auth import JupyterHubAuthPlugin
c = get_config()
c.Application.log_level = 30
c.Authenticator.plugin_class = JupyterHubAuthPlugin
c.Exchange.path_includes_course = True
c.Exchange.root = "/srv/nbgrader/exchange"
c.ExecutePreprocessor.iopub_timeout=1800
c.ExecutePreprocessor.timeout=3600
| 20.6 | 51 | 0.825243 | from nbgrader.auth import JupyterHubAuthPlugin
c = get_config()
c.Application.log_level = 30
c.Authenticator.plugin_class = JupyterHubAuthPlugin
c.Exchange.path_includes_course = True
c.Exchange.root = "/srv/nbgrader/exchange"
c.ExecutePreprocessor.iopub_timeout=1800
c.ExecutePreprocessor.timeout=3600
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8647ff7e2ccc891de38e05613dc057b290d1ed18 | 32,540 | py | Python | tests/admin_changelist/tests.py | devops2014/djangosite | db77915c9fd35a203edd8206f702ee4082f04d4a | [
"BSD-3-Clause"
] | null | null | null | tests/admin_changelist/tests.py | devops2014/djangosite | db77915c9fd35a203edd8206f702ee4082f04d4a | [
"BSD-3-Clause"
] | null | null | null | tests/admin_changelist/tests.py | devops2014/djangosite | db77915c9fd35a203edd8206f702ee4082f04d4a | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
| 45.766526 | 164 | 0.653934 | from __future__ import unicode_literals
import datetime
from django.contrib import admin
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.templatetags.admin_list import pagination
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.admi... | 0 | 30,326 | 0 | 852 | 0 | 0 | 0 | 891 | 426 |
db0f8ab101b84a60021a859ef789132b6c6130ab | 4,723 | py | Python | emukit/examples/multi_fidelity_dgp/baseline_model_wrappers.py | ndalchau/emukit | eb6754ea016a7cd82b275bb4075676b5ed662634 | [
"Apache-2.0"
] | 152 | 2020-10-24T13:12:57.000Z | 2022-03-25T11:35:41.000Z | emukit/examples/multi_fidelity_dgp/baseline_model_wrappers.py | Tony-Chiong/emukit | a068c8d5e06b2ae8b038f67bf2e4f66c4d91651a | [
"Apache-2.0"
] | 87 | 2020-10-26T10:29:25.000Z | 2022-03-04T11:17:59.000Z | emukit/examples/multi_fidelity_dgp/baseline_model_wrappers.py | Tony-Chiong/emukit | a068c8d5e06b2ae8b038f67bf2e4f66c4d91651a | [
"Apache-2.0"
] | 41 | 2020-10-24T11:59:21.000Z | 2022-03-22T17:08:30.000Z | """
These are emukit model wrappers that contain the specific optimization procedures we found worked well for each model.
The constructor for each model takes X and Y as lists, with each entry of the list corresponding to data for a fidelity
"""
import logging
_log = logging.getLogger(__name__)
| 33.027972 | 119 | 0.665043 | """
These are emukit model wrappers that contain the specific optimization procedures we found worked well for each model.
The constructor for each model takes X and Y as lists, with each entry of the list corresponding to data for a fidelity
"""
import logging
import GPy
import numpy as np
from ...core.interfaces i... | 0 | 246 | 0 | 3,646 | 0 | 0 | 0 | 282 | 247 |
dea20d08c65d75f519b5060b937d68920ccbea77 | 8,174 | py | Python | masp/spherical_array_processing/evaluate_sht_filters.py | andresperezlopez/masp | c6385b6635b5e86233152ccfea2df15caee6acc7 | [
"BSD-3-Clause"
] | 19 | 2020-06-07T10:58:11.000Z | 2022-02-10T08:48:15.000Z | masp/spherical_array_processing/evaluate_sht_filters.py | andresperezlopez/masp | c6385b6635b5e86233152ccfea2df15caee6acc7 | [
"BSD-3-Clause"
] | null | null | null | masp/spherical_array_processing/evaluate_sht_filters.py | andresperezlopez/masp | c6385b6635b5e86233152ccfea2df15caee6acc7 | [
"BSD-3-Clause"
] | 5 | 2020-06-29T07:12:03.000Z | 2021-11-06T12:25:47.000Z | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Copyright (c) 2019, Eurecat / UPF
# 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... | 40.465347 | 139 | 0.630536 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Copyright (c) 2019, Eurecat / UPF
# 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... | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 |
07c09b4f3e610e9e9acb328dbcd7cb6d5ad95305 | 707 | py | Python | linkedlist/first_cyclic_node.py | AnshulPatni/Algorithms | c8bcfb86d50f68041921e5140f01821ac12d9521 | [
"MIT"
] | 2 | 2018-04-30T19:31:04.000Z | 2018-05-05T14:29:45.000Z | linkedlist/first_cyclic_node.py | AnshulPatni/Algorithms | c8bcfb86d50f68041921e5140f01821ac12d9521 | [
"MIT"
] | null | null | null | linkedlist/first_cyclic_node.py | AnshulPatni/Algorithms | c8bcfb86d50f68041921e5140f01821ac12d9521 | [
"MIT"
] | 1 | 2018-04-16T12:45:49.000Z | 2018-04-16T12:45:49.000Z | """
Given a linked list, find the first node of a cycle in it.
1 -> 2 -> 3 -> 4 -> 5 -> 1 => 1
A -> B -> C -> D -> E -> C => C
Note: The solution is a direct implementation
Floyd's cycle-finding algorithm (Floyd's Tortoise and Hare).
"""
def firstCyclicNode(head):
"""
:type head: ... | 23.566667 | 70 | 0.5686 | """
Given a linked list, find the first node of a cycle in it.
1 -> 2 -> 3 -> 4 -> 5 -> 1 => 1
A -> B -> C -> D -> E -> C => C
Note: The solution is a direct implementation
Floyd's cycle-finding algorithm (Floyd's Tortoise and Hare).
"""
def firstCyclicNode(head):
"""
:type head: ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
569b8568f568c9cc9c98f203a6144f0b659dd00e | 2,453 | py | Python | Arduino Robot/PC_Clients/PythonRobotController/RESTPublishClient/RESTClient.py | wso2-incubator/device-cloud-appliances | c91229cede8f0a302446a4ad0aaba7cfd86898cc | [
"Apache-2.0"
] | null | null | null | Arduino Robot/PC_Clients/PythonRobotController/RESTPublishClient/RESTClient.py | wso2-incubator/device-cloud-appliances | c91229cede8f0a302446a4ad0aaba7cfd86898cc | [
"Apache-2.0"
] | null | null | null | Arduino Robot/PC_Clients/PythonRobotController/RESTPublishClient/RESTClient.py | wso2-incubator/device-cloud-appliances | c91229cede8f0a302446a4ad0aaba7cfd86898cc | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python
import serial
import time
bluetoothSerial = serial.Serial( "/dev/tty.HC-06-DevB", baudrate=9600 )
serverIP = "localhost"
serverPort = "8080"
publisherEndpoint = "/ConnectedDevices/pushdata"
#"/pushdata/{ip}/{owner}/{type}/{mac}/{time}/{pin}/{value}")
deviceIP = "/192.168.1.999"
deviceOwner = "/SM... | 22.504587 | 135 | 0.614757 | #! /usr/bin/python
import serial
import time
import requests
import datetime
import thread
import time
bluetoothSerial = serial.Serial( "/dev/tty.HC-06-DevB", baudrate=9600 )
serverIP = "localhost"
serverPort = "8080"
publisherEndpoint = "/ConnectedDevices/pushdata"
#"/pushdata/{ip}/{owner}/{type}/{mac}/{time}/{pin... | 0 | 0 | 0 | 450 | 0 | 1,248 | 0 | -21 | 202 |
556b37bde6ed7dc092a133d1fa97a7da1e6d3eaf | 1,626 | py | Python | redis/concurrency/threadpool_imgur.py | fengpf/py | 21f18573d97036d2b3796a16436de1895064def0 | [
"MIT"
] | 148 | 2015-03-20T08:50:52.000Z | 2022-02-20T21:18:53.000Z | threadpool_imgur.py | volker48/python-concurrency | 184db1527bbf48c1483cb0657f4696dc953867cb | [
"MIT"
] | 9 | 2015-10-16T09:01:36.000Z | 2022-03-11T23:20:57.000Z | threadpool_imgur.py | gwsu2008/python-concurrency | 252ddb1d7196b8a386dc3dc3564d8da8f30eff28 | [
"MIT"
] | 73 | 2015-03-20T09:31:22.000Z | 2022-01-17T13:10:05.000Z | ####
# This sample is published as part of the blog article at www.toptal.com/blog
# Visit www.toptal.com/blog and subscribe to our newsletter to read great posts
####
import logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__na... | 36.954545 | 122 | 0.730627 | ####
# This sample is published as part of the blog article at www.toptal.com/blog
# Visit www.toptal.com/blog and subscribe to our newsletter to read great posts
####
import logging
import os
from concurrent.futures import ThreadPoolExecutor
from functools import partial
from time import time
from download import se... | 0 | 0 | 0 | 0 | 0 | 1,057 | 0 | 68 | 134 |
d8454e302db0e3b89273f2a1027420e601f162e4 | 278 | py | Python | 1_beginner/chapter7/solutions/first_three_words.py | code4tomorrow/Python | 035b6f5d8fd635a16caaff78bcd3f582663dadc3 | [
"MIT"
] | 4 | 2021-03-01T00:32:45.000Z | 2021-05-21T22:01:52.000Z | 1_beginner/chapter7/solutions/first_three_words.py | code4tomorrow/Python | 035b6f5d8fd635a16caaff78bcd3f582663dadc3 | [
"MIT"
] | 29 | 2020-09-12T22:56:04.000Z | 2021-09-25T17:08:42.000Z | 1_beginner/chapter7/solutions/first_three_words.py | code4tomorrow/Python | 035b6f5d8fd635a16caaff78bcd3f582663dadc3 | [
"MIT"
] | 7 | 2021-02-25T01:50:55.000Z | 2022-02-28T00:00:42.000Z | """
First Three Words
Write a program which asks
the user to enter a sentence.
Print the first three words in the sentence.
(Assume the user enters at least 3 words.)
"""
sentence = input("Enter a sentence: ")
words = sentence.split()
for word in words[:3]:
print(word)
| 17.375 | 44 | 0.708633 | """
First Three Words
Write a program which asks
the user to enter a sentence.
Print the first three words in the sentence.
(Assume the user enters at least 3 words.)
"""
sentence = input("Enter a sentence: ")
words = sentence.split()
for word in words[:3]:
print(word)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b6b6f58927be4d96e344bc459e393288445d1051 | 404 | py | Python | Employment_System/apps/users/migrations/0002_user_imgurl.py | rui1106/Graduation_Project | 77457588f82cfa8c35b74fc60ec3c1ffd5271600 | [
"CC0-1.0"
] | null | null | null | Employment_System/apps/users/migrations/0002_user_imgurl.py | rui1106/Graduation_Project | 77457588f82cfa8c35b74fc60ec3c1ffd5271600 | [
"CC0-1.0"
] | null | null | null | Employment_System/apps/users/migrations/0002_user_imgurl.py | rui1106/Graduation_Project | 77457588f82cfa8c35b74fc60ec3c1ffd5271600 | [
"CC0-1.0"
] | null | null | null | # Generated by Django 2.2.5 on 2022-03-02 12:32
| 21.263158 | 85 | 0.591584 | # Generated by Django 2.2.5 on 2022-03-02 12:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='ImgUrl',
field=m... | 6 | 0 | 0 | 288 | 0 | 0 | 0 | 19 | 46 |
81d2cae57ab8e0815f198becb724e531a46d96fe | 3,183 | py | Python | gtkssw.py | dmitriiweb/Stopwatch | f8b1921da6b6a823e6d874cc5fe3fe5c366d2f06 | [
"MIT"
] | 1 | 2020-11-09T10:44:16.000Z | 2020-11-09T10:44:16.000Z | gtkssw.py | dmitriiweb/Stopwatch | f8b1921da6b6a823e6d874cc5fe3fe5c366d2f06 | [
"MIT"
] | null | null | null | gtkssw.py | dmitriiweb/Stopwatch | f8b1921da6b6a823e6d874cc5fe3fe5c366d2f06 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
BASEDIR = os.path.dirname(os.path.abspath(__file__))
if __name__ == '__main__':
win = StopWatch()
icon_path = os.path.join(BASEDIR, 'stopwatch.png')
win.set_icon_from_file(icon_path)
win.connec... | 32.151515 | 98 | 0.650016 | #!/usr/bin/env python3
import datetime
import os
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GObject
BASEDIR = os.path.dirname(os.path.abspath(__file__))
class StopWatch(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title='Stopwatch')
self.create_variab... | 0 | 0 | 0 | 2,753 | 0 | 0 | 0 | 3 | 45 |
d325bb8b5bd131bccf2d5094bfd89865d38cb9f5 | 417 | py | Python | blog/migrations/0004_blogpost_image.py | skynette/CSMD | 8b3f90adad2d18569ef44b235a1213c547f94f22 | [
"CC-BY-3.0"
] | null | null | null | blog/migrations/0004_blogpost_image.py | skynette/CSMD | 8b3f90adad2d18569ef44b235a1213c547f94f22 | [
"CC-BY-3.0"
] | null | null | null | blog/migrations/0004_blogpost_image.py | skynette/CSMD | 8b3f90adad2d18569ef44b235a1213c547f94f22 | [
"CC-BY-3.0"
] | null | null | null | # Generated by Django 3.0.6 on 2021-01-10 17:55
| 21.947368 | 89 | 0.592326 | # Generated by Django 3.0.6 on 2021-01-10 17:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_blogpost_views'),
]
operations = [
migrations.AddField(
model_name='blogpost',
name='image',
... | 0 | 0 | 0 | 303 | 0 | 0 | 0 | 19 | 46 |
6771a7c9409ba16d21ba2ac2dc43bc32f72bf439 | 2,565 | py | Python | apps/student_mgmt/app.py | PrasadHonrao/python-samples | faa48aa3eaf2d67b8cef0114e1f6ef08e2c1300a | [
"MIT"
] | 3 | 2018-08-20T13:00:01.000Z | 2021-09-18T04:19:46.000Z | apps/student_mgmt/app.py | PrasadHonrao/python-samples | faa48aa3eaf2d67b8cef0114e1f6ef08e2c1300a | [
"MIT"
] | 1 | 2021-06-25T20:25:02.000Z | 2021-08-19T22:44:31.000Z | apps/student_mgmt/app.py | PrasadHonrao/python-samples | faa48aa3eaf2d67b8cef0114e1f6ef08e2c1300a | [
"MIT"
] | 1 | 2021-09-18T23:51:20.000Z | 2021-09-18T23:51:20.000Z | """
Student management module
"""
students = []
def get_student_title_case() -> str:
"""
Function to return student name in title case
:return: student name
"""
students_title_case = []
for student in students:
students_title_case.append(student["name"].title())
retur... | 26.173469 | 81 | 0.65575 | """
Student management module
"""
students = []
def get_student_title_case() -> str:
"""
Function to return student name in title case
:return: student name
"""
students_title_case = []
for student in students:
students_title_case.append(student["name"].title())
retur... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f188b0989d76a3e9d827b499042fb58f173865f0 | 1,334 | py | Python | scripts/common_features.py | kdelwat/LangEvolve | 6e400f9e3d7ff7bc0dce0d1db0af3682b2ad0e01 | [
"MIT"
] | 29 | 2016-12-18T08:44:26.000Z | 2022-03-20T09:39:22.000Z | scripts/common_features.py | kdelwat/LangEvolve | 6e400f9e3d7ff7bc0dce0d1db0af3682b2ad0e01 | [
"MIT"
] | 11 | 2016-11-22T01:13:11.000Z | 2022-03-04T21:21:15.000Z | scripts/common_features.py | kdelwat/LangEvolve | 6e400f9e3d7ff7bc0dce0d1db0af3682b2ad0e01 | [
"MIT"
] | 5 | 2017-02-07T08:54:49.000Z | 2022-01-13T15:23:45.000Z | # common_features.py
# Invoke on the command line like: python common_features.py pbtd
# Outputs all features common to all of the given segments, to help
# in rule writing.
import csv
import sys
import os.path as path
base_directory = path.dirname(path.dirname(path.abspath(__file__)))
sys.path.append(base_directory)
... | 31.023256 | 79 | 0.66042 | # common_features.py
# Invoke on the command line like: python common_features.py pbtd
# Outputs all features common to all of the given segments, to help
# in rule writing.
from tabulate import tabulate
import csv
import sys
import os.path as path
base_directory = path.dirname(path.dirname(path.abspath(__file__)))
s... | 0 | 0 | 0 | 0 | 0 | 647 | 0 | 8 | 46 |
eb7f5a8a820668422a863c8028972cebdb13707d | 8,150 | py | Python | simplemud.py | alexandershuping/MuddySwamp | c9fea7f9b5b0c372afdffdbc24f29eb90fd5881d | [
"MIT"
] | null | null | null | simplemud.py | alexandershuping/MuddySwamp | c9fea7f9b5b0c372afdffdbc24f29eb90fd5881d | [
"MIT"
] | null | null | null | simplemud.py | alexandershuping/MuddySwamp | c9fea7f9b5b0c372afdffdbc24f29eb90fd5881d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import time
# import the MUD server class
from mudserver import MudServer, EventType
#prints to stderr
VERBOSE_PRINT = False
# structure defining the rooms in the game. Try adding more rooms to the game!
rooms = {
"Tavern": {
"description": "You're in a cozy tavern warmed by an ope... | 43.351064 | 89 | 0.480613 | #!/usr/bin/env python
import time
import sys
# import the MUD server class
from mudserver import MudServer, Event, EventType
#prints to stderr
def err_print(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
VERBOSE_PRINT = False
def v_print(*args, **kwargs):
if VERBOSE_PRINT:
err_print(*args, **kwargs)
... | 0 | 0 | 0 | 0 | 0 | 107 | 0 | -4 | 66 |
67e72487e0c252d181d62a1ff9eaf9df986e0154 | 322 | py | Python | shopit/forms/flag.py | dinoperovic/djangoshop-shopit | b42a2bf0ec319817eb37ef939608b04498fc4ff2 | [
"BSD-3-Clause"
] | 14 | 2016-11-25T16:06:20.000Z | 2018-08-30T19:20:41.000Z | shopit/forms/flag.py | dinoperovic/djangoshop-shopit | b42a2bf0ec319817eb37ef939608b04498fc4ff2 | [
"BSD-3-Clause"
] | 3 | 2017-04-14T13:18:22.000Z | 2018-07-18T11:34:53.000Z | shopit/forms/flag.py | dinoperovic/django-shop | b42a2bf0ec319817eb37ef939608b04498fc4ff2 | [
"BSD-3-Clause"
] | 6 | 2019-04-07T23:52:54.000Z | 2020-09-20T05:30:07.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
| 23 | 58 | 0.751553 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from mptt.forms import MPTTAdminForm
from parler.forms import TranslatableModelForm
from shopit.models.flag import Flag
class FlagModelForm(MPTTAdminForm, TranslatableModelForm):
class Meta:
model = Flag
exclude = [... | 0 | 0 | 0 | 95 | 0 | 0 | 0 | 54 | 91 |
e42b7212e9b3fc61daf5b1358fef5f37df1dac80 | 1,623 | py | Python | re_findall.py | akiselev1/hackerrank-solutions | 53c2a76c71c9b3553c077ccfde5178b27594ae72 | [
"MIT"
] | null | null | null | re_findall.py | akiselev1/hackerrank-solutions | 53c2a76c71c9b3553c077ccfde5178b27594ae72 | [
"MIT"
] | null | null | null | re_findall.py | akiselev1/hackerrank-solutions | 53c2a76c71c9b3553c077ccfde5178b27594ae72 | [
"MIT"
] | null | null | null | """
Created by akiselev on 2019-06-13
re.findall()
The expression re.findall() returns all the non-overlapping matches of patterns in a string as a list of strings.
Code
>>> import re
>>> re.findall(r'\w','http://www.hackerrank.com/')
['h', 't', 't', 'p', 'w', 'w', 'w', 'h', 'a', 'c', 'k', 'e', 'r', 'r', 'a', 'n... | 24.969231 | 146 | 0.676525 | """
Created by akiselev on 2019-06-13
re.findall()
The expression re.findall() returns all the non-overlapping matches of patterns in a string as a list of strings.
Code
>>> import re
>>> re.findall(r'\w','http://www.hackerrank.com/')
['h', 't', 't', 'p', 'w', 'w', 'w', 'h', 'a', 'c', 'k', 'e', 'r', 'r', 'a', 'n... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ddc3ae83023e4553b939bfb770711ae4531a84d8 | 3,120 | py | Python | launcher.py | nomanbaig98/syntax-analyzer-python | 426d4890603c6075d126217718ed413a065aad42 | [
"MIT"
] | null | null | null | launcher.py | nomanbaig98/syntax-analyzer-python | 426d4890603c6075d126217718ed413a065aad42 | [
"MIT"
] | null | null | null | launcher.py | nomanbaig98/syntax-analyzer-python | 426d4890603c6075d126217718ed413a065aad42 | [
"MIT"
] | null | null | null | from antlr4 import CommonTokenStream
from src.Python3Lexer import Python3Lexer
from src.Python3Parser import Python3Parser
from antlr4.tree.Tree import TerminalNodeImpl
import json
def walk(subtree, rule_names):
""" Function for converting tree to dictionary
Function takes subtree and array of names and... | 27.610619 | 79 | 0.674038 | from antlr4 import FileStream, CommonTokenStream
from src.Python3Lexer import Python3Lexer
from src.Python3Parser import Python3Parser
from antlr4.tree.Tree import TerminalNodeImpl
from antlr4.error.ErrorListener import ErrorListener
import json
class FileErrorListener(ErrorListener):
"""Class for storing errors ... | 0 | 0 | 0 | 303 | 0 | 247 | 0 | 43 | 68 |
1bf19843567acc9a0e6fa51958307c151fa4cdf0 | 503 | py | Python | mediafeed/api/server.py | media-feed/mediafeed | c2fb37b20a5bc41a4299193fa9b11f8a3e3b2acf | [
"MIT"
] | null | null | null | mediafeed/api/server.py | media-feed/mediafeed | c2fb37b20a5bc41a4299193fa9b11f8a3e3b2acf | [
"MIT"
] | null | null | null | mediafeed/api/server.py | media-feed/mediafeed | c2fb37b20a5bc41a4299193fa9b11f8a3e3b2acf | [
"MIT"
] | null | null | null | import os
from bottle import Bottle
from whitenoise import WhiteNoise
from ..settings import DATA_PATH
api = Bottle()
application = WhiteNoise(api)
application.add_files(os.path.join(DATA_PATH, 'thumbnails'), prefix='thumbnails/')
application.add_files(os.path.join(DATA_PATH, 'medias'), prefix='medias/')
| 23.952381 | 82 | 0.747515 | import os
from bottle import Bottle, response
from whitenoise import WhiteNoise
from ..settings import DATA_PATH
api = Bottle()
@api.hook('after_request')
def enable_cors():
response.headers['Access-Control-Allow-Origin'] = '*'
response.headers['Access-Control-Allow-Methods'] = 'GET, POST, DELETE'
appli... | 0 | 157 | 0 | 0 | 0 | 0 | 0 | 10 | 23 |
f0821f7691b0cefe6e266ce8feb7fa9ca9ca7209 | 300 | py | Python | katas/kyu_7/what_is_my_name_score_1.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | katas/kyu_7/what_is_my_name_score_1.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | katas/kyu_7/what_is_my_name_score_1.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | # for testing only, 'alpha' is included in the preloaded section on Codewars
alpha = {'ABCDE': 1, 'FGHIJ': 2, 'KLMNO': 3, 'PQRST': 4, 'UVWXY': 5}
| 37.5 | 76 | 0.643333 | # for testing only, 'alpha' is included in the preloaded section on Codewars
alpha = {'ABCDE': 1, 'FGHIJ': 2, 'KLMNO': 3, 'PQRST': 4, 'UVWXY': 5}
def name_score(name):
scores = {k: v for keys, v in alpha.iteritems() for k in keys}
return {name: sum(scores.get(a, 0) for a in name.upper())}
| 0 | 0 | 0 | 0 | 0 | 130 | 0 | 0 | 23 |
2875aa0e22df649277cae1742669f39f25d038f2 | 1,932 | py | Python | qdk/qdk/chemistry/broombridge.py | Anatoliy-Litvinenko/qdk-python | 74b2638a404717424090023ef49afb3045ea920e | [
"MIT"
] | 53 | 2021-01-21T23:38:09.000Z | 2022-03-29T16:34:42.000Z | qdk/qdk/chemistry/broombridge.py | Anatoliy-Litvinenko/qdk-python | 74b2638a404717424090023ef49afb3045ea920e | [
"MIT"
] | 152 | 2021-01-23T07:01:49.000Z | 2022-03-31T19:43:21.000Z | qdk/qdk/chemistry/broombridge.py | slowy07/qdk-python | e4ce0c433cc986bc1c746e9a58f3f05733c657e2 | [
"MIT"
] | 47 | 2021-01-30T20:15:46.000Z | 2022-03-25T23:35:28.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
##
# Module for loading and encoding Broombridge data
##
import logging
from qsharp.chemistry import load_broombridge, load_input_state, encode
from typing import List, Tuple
NumQubits = int
HamiltonianTermList = Tuple[List[Tuple[List[int], List... | 29.723077 | 79 | 0.728778 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
##
# Module for loading and encoding Broombridge data
##
import logging
from qsharp.chemistry import load_broombridge, load_input_state, encode
from typing import List, Tuple
NumQubits = int
HamiltonianTermList = Tuple[List[Tuple[List[int], List... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
262be4baffa1f0ba78fdcc51038b21e05e64bc18 | 193 | py | Python | TSIS5/10.py | ayazhan112/python- | fba09ecc25e11dbfb116f273838b13174f66126d | [
"MIT"
] | null | null | null | TSIS5/10.py | ayazhan112/python- | fba09ecc25e11dbfb116f273838b13174f66126d | [
"MIT"
] | null | null | null | TSIS5/10.py | ayazhan112/python- | fba09ecc25e11dbfb116f273838b13174f66126d | [
"MIT"
] | null | null | null |
print('Number of words:', word_count('test.txt'))
| 27.571429 | 50 | 0.668394 | from collections import Counter
def word_count(file_name):
with open(file_name, 'r') as f:
return Counter(f.read().split())
print('Number of words:', word_count('test.txt'))
| 0 | 0 | 0 | 0 | 0 | 84 | 0 | 10 | 46 |
510971622a2d34c62749680ee58612a8430d1019 | 7,136 | py | Python | torchreid/engine/image/triplet.py | Vill-Lab/IGOAS | 42ca1d45e441f993c95b5e8f33c9f97ea3b916f3 | [
"MIT"
] | 8 | 2021-05-27T10:19:28.000Z | 2021-10-15T12:38:04.000Z | torchreid/engine/image/triplet.py | Vill-Lab/IGOAS | 42ca1d45e441f993c95b5e8f33c9f97ea3b916f3 | [
"MIT"
] | 3 | 2021-06-23T12:06:39.000Z | 2021-09-12T08:40:44.000Z | torchreid/engine/image/triplet.py | Vill-Lab/IGOAS | 42ca1d45e441f993c95b5e8f33c9f97ea3b916f3 | [
"MIT"
] | 6 | 2021-05-27T10:19:18.000Z | 2021-11-13T12:02:17.000Z | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
| 38.160428 | 120 | 0.582399 | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import time
import datetime
import torch
import torchreid
from torchreid.engine import engine
from torchreid.losses import CrossEntropyLoss, TripletLoss, HctLoss
from torchreid.utils import AverageMeter, open... | 0 | 0 | 0 | 6,727 | 0 | 0 | 0 | 97 | 202 |
11bdfe506c8bdf705d13a3bfae5ffc73fd0be948 | 1,335 | py | Python | HSCTF2021/Crypto/opisthocomus-hoazin.py | yl-ang/CTF | a075231a3dc32630a26f3b2d4dfc1dd9b9f1e0b9 | [
"MIT"
] | null | null | null | HSCTF2021/Crypto/opisthocomus-hoazin.py | yl-ang/CTF | a075231a3dc32630a26f3b2d4dfc1dd9b9f1e0b9 | [
"MIT"
] | null | null | null | HSCTF2021/Crypto/opisthocomus-hoazin.py | yl-ang/CTF | a075231a3dc32630a26f3b2d4dfc1dd9b9f1e0b9 | [
"MIT"
] | 3 | 2021-06-28T09:52:07.000Z | 2021-09-22T03:28:40.000Z | # crypto/opisthocomus-hoazin
e, n = (65537, 15888457769674642859708800597310299725338251830976423740469342107745469667544014118426981955901595652146093596535042454720088489883832573612094938281276141337632202496209218136026441342435018861975571842724577501821204305185018320446993699281538507826943542962060000957702417... | 222.5 | 633 | 0.836704 | # crypto/opisthocomus-hoazin
e, n = (65537, 15888457769674642859708800597310299725338251830976423740469342107745469667544014118426981955901595652146093596535042454720088489883832573612094938281276141337632202496209218136026441342435018861975571842724577501821204305185018320446993699281538507826943542962060000957702417... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a9312b6a278eb78e59ba06e693a5e9f1f7d1cb2c | 284 | py | Python | problem/01000~09999/02511/2511.pypy3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 1 | 2019-04-19T16:37:44.000Z | 2019-04-19T16:37:44.000Z | problem/01000~09999/02511/2511.pypy3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 1 | 2019-04-20T11:42:44.000Z | 2019-04-20T11:42:44.000Z | problem/01000~09999/02511/2511.pypy3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 3 | 2019-04-19T16:37:47.000Z | 2021-10-25T00:45:00.000Z | a,b,A,B,l=list(map(int, input().split())), list(map(int, input().split())),0,0,0
for i in range(10): (A,B,l) = (A+3,B,1) if a[i]>b[i] else (A,B+3,2) if a[i]<b[i] else (A+1,B+1,l)
print('{} {}\n{}'.format(A,B, 'A' if A>B or (A==B and l==1) else 'B' if A<B or (A==B and l==2) else 'D')) | 94.666667 | 105 | 0.521127 | a,b,A,B,l=list(map(int, input().split())), list(map(int, input().split())),0,0,0
for i in range(10): (A,B,l) = (A+3,B,1) if a[i]>b[i] else (A,B+3,2) if a[i]<b[i] else (A+1,B+1,l)
print('{} {}\n{}'.format(A,B, 'A' if A>B or (A==B and l==1) else 'B' if A<B or (A==B and l==2) else 'D')) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
70ac7ff92d4189250299cb7c47f28f8a6c285c49 | 1,452 | py | Python | kombu_aliyun_mqs/aliyun_mqs/mqs_exception.py | YuelianINC/kombu-aliyun-mqs | c385e256c9c020effde03f10bb73f323e4548973 | [
"Apache-2.0"
] | 1 | 2017-04-20T03:43:08.000Z | 2017-04-20T03:43:08.000Z | kombu_aliyun_mqs/aliyun_mqs/mqs_exception.py | YuelianINC/kombu-aliyun-mqs | c385e256c9c020effde03f10bb73f323e4548973 | [
"Apache-2.0"
] | null | null | null | kombu_aliyun_mqs/aliyun_mqs/mqs_exception.py | YuelianINC/kombu-aliyun-mqs | c385e256c9c020effde03f10bb73f323e4548973 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
| 30.893617 | 68 | 0.65427 | # -*- coding: utf-8 -*-
class MQSExceptionBase(Exception):
def __init__(self, type, message):
self.type = type
self.message = message
def get_info(self):
return "(\"%s\" \"%s\")\n" % (self.type, self.message)
def __str__(self):
return "MQSExceptionBase %s" % (self.get_inf... | 0 | 0 | 0 | 1,296 | 0 | 0 | 0 | 0 | 123 |
3f4387a58d4f1914a658e49891ce4cb5c24e3ba2 | 7,610 | py | Python | apps/python/MiTuner_socket_server.py | UBTEDU/ZLK38AVS | 050ac1d98fbb65bd5bacd4e2024a65a4465a5731 | [
"MIT"
] | 1 | 2020-03-30T05:50:08.000Z | 2020-03-30T05:50:08.000Z | apps/python/MiTuner_socket_server.py | UBTEDU/ZLK38AVS | 050ac1d98fbb65bd5bacd4e2024a65a4465a5731 | [
"MIT"
] | null | null | null | apps/python/MiTuner_socket_server.py | UBTEDU/ZLK38AVS | 050ac1d98fbb65bd5bacd4e2024a65a4465a5731 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# MiTuner_socket_server.py -- Python 2.7 socket server to be used with MiTuner Bridge
# Copyright 2018 Microsemi Inc. All rights reserved.
#Licensed under the MIT License. See LICENSE.txt in the project root for license information.
from os.path import dirname, realpath
import argparse
import... | 31.446281 | 147 | 0.508936 | #!/usr/bin/env python
# MiTuner_socket_server.py -- Python 2.7 socket server to be used with MiTuner Bridge
# Copyright 2018 Microsemi Inc. All rights reserved.
#Licensed under the MIT License. See LICENSE.txt in the project root for license information.
from os.path import dirname, realpath, isfile
import argpars... | 0 | 0 | 0 | 0 | 0 | 3,623 | 0 | 154 | 308 |
c660ad90eae4fb538c71d5a8dc812c1fba056f81 | 4,732 | py | Python | signing.py | tsunghowu/DiskImageCreator | b56d6cdf20fcedc70f64f1a89a73934460ac9973 | [
"MIT"
] | 1 | 2021-03-07T12:13:58.000Z | 2021-03-07T12:13:58.000Z | signing.py | tsunghowu/DiskImageCreator | b56d6cdf20fcedc70f64f1a89a73934460ac9973 | [
"MIT"
] | null | null | null | signing.py | tsunghowu/DiskImageCreator | b56d6cdf20fcedc70f64f1a89a73934460ac9973 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# File name: name.py
import sys
import json
import os
import rsa
import struct
import json
base = [str(x) for x in range(10)] + [chr(x) for x in range(ord('A'), ord('A') + 6)]
if __name__ == '__main__':
print 'Signing Tool for the new Secure Boot validation. Version: 1.01'
print ' Thi... | 36.682171 | 105 | 0.560862 | #!/usr/bin/env python
# File name: name.py
import sys
import json
import os
import rsa
import struct
import json
from block import *
from controlblock import *
base = [str(x) for x in range(10)] + [chr(x) for x in range(ord('A'), ord('A') + 6)]
def object_compare(x, y): #used for compare key in dict.
if x['Seq']... | 0 | 0 | 0 | 0 | 0 | 179 | 0 | 3 | 67 |
91ed008cb5ddfd5bd67892c75d563cdad9ee65b3 | 11,416 | py | Python | tools/android/loading/analyze.py | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | tools/android/loading/analyze.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | tools/android/loading/analyze.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | #! /usr/bin/python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cgi
import json
import logging
import os
import sys
import tempfile
import time
_SRC_DIR = os.path.abspath(os.path.join(
os.pat... | 33.576471 | 80 | 0.689296 | #! /usr/bin/python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import cgi
import json
import logging
import os
import subprocess
import sys
import tempfile
import time
_SRC_DIR = os.pa... | 0 | 0 | 0 | 0 | 0 | 5,718 | 0 | 58 | 519 |
86fa212ba13d057b37a3828ca0036bad8f61bb80 | 523 | py | Python | database/serializers.py | taixingbi/tmp | e3f941f04f08279df59ef016debfe7eb826fc639 | [
"MIT"
] | null | null | null | database/serializers.py | taixingbi/tmp | e3f941f04f08279df59ef016debfe7eb826fc639 | [
"MIT"
] | 7 | 2020-06-06T01:22:35.000Z | 2022-02-10T10:22:37.000Z | database/serializers.py | taixingbi/tmp | e3f941f04f08279df59ef016debfe7eb826fc639 | [
"MIT"
] | null | null | null | #from .models import Account, Teleconference_transcribe
# class Teleconference_transcribeSerializer(serializers.HyperlinkedModelSerializer):
# class Meta:
# model = Teleconference_transcribe
# fields = ['filename', 'transcription', 'transcription_baseline'] | 32.6875 | 84 | 0.759082 | from rest_framework import serializers
from .models import Ml_test
#from .models import Account, Teleconference_transcribe
from rest_framework import filters
class Ml_testSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Ml_test
fields = ['email', 'name']
# class Teleconfer... | 0 | 0 | 0 | 118 | 0 | 0 | 0 | 36 | 90 |
a4be4402db5e8948e7572b20983b2d63d21cfd9c | 11,313 | py | Python | update.py | Hmaksu/Zoom-Duration-Calculator | 118dbc17997b54f398914fb399ca2c882b0d0969 | [
"MIT"
] | null | null | null | update.py | Hmaksu/Zoom-Duration-Calculator | 118dbc17997b54f398914fb399ca2c882b0d0969 | [
"MIT"
] | null | null | null | update.py | Hmaksu/Zoom-Duration-Calculator | 118dbc17997b54f398914fb399ca2c882b0d0969 | [
"MIT"
] | null | null | null |
root = Tk()
root.title("CivilCon")
root.iconbitmap("CC.ico")
root.geometry("500x500")
e = CivilCon(root)
root.mainloop()
| 45.616935 | 497 | 0.455847 | from tkinter import *
from tkinter import filedialog
from tkinter.ttk import *
import os
import xlrd
import xlsxwriter
root = Tk()
root.title("CivilCon")
root.iconbitmap("CC.ico")
root.geometry("500x500")
class CivilCon:
def __init__(self, master): #First Page
self.master = master
... | 34 | 0 | 0 | 10,999 | 0 | 0 | 0 | -13 | 163 |
7c1a8a729126d66fb236ad7b867867032e450e54 | 6,836 | py | Python | tools/svctool/svctool.py | ricaun/basicmac | 69e55e953b652ef26e52819ab77559e4a81baf70 | [
"BSD-3-Clause"
] | 1 | 2021-11-27T22:56:15.000Z | 2021-11-27T22:56:15.000Z | tools/svctool/svctool.py | ricaun/basicmac | 69e55e953b652ef26e52819ab77559e4a81baf70 | [
"BSD-3-Clause"
] | null | null | null | tools/svctool/svctool.py | ricaun/basicmac | 69e55e953b652ef26e52819ab77559e4a81baf70 | [
"BSD-3-Clause"
] | 1 | 2021-04-03T09:55:58.000Z | 2021-04-03T09:55:58.000Z | #!/usr/bin/env python3
# Copyright (C) 2016-2019 Semtech (International) AG. All rights reserved.
#
# This file is subject to the terms and conditions defined in file 'LICENSE',
# which is part of this source code package.
if __name__ == '__main__':
ServiceTool().run()
| 36.169312 | 111 | 0.526624 | #!/usr/bin/env python3
# Copyright (C) 2016-2019 Semtech (International) AG. All rights reserved.
#
# This file is subject to the terms and conditions defined in file 'LICENSE',
# which is part of this source code package.
import os
import shlex
import sys
import re
import yaml
from typing import Callable,Dict,List,... | 0 | 3,370 | 0 | 2,848 | 0 | 0 | 0 | 9 | 332 |
060d91d98cf50dfe7b09fa612b44c1ea377349ae | 5,502 | py | Python | predict.py | pr-shukla/maddpg-keras | 8e3d1501f78ac2b78ee2c7053dc9299862386c17 | [
"MIT"
] | 4 | 2021-09-22T13:38:05.000Z | 2022-02-11T02:09:54.000Z | predict.py | pr-shukla/maddpg-keras | 8e3d1501f78ac2b78ee2c7053dc9299862386c17 | [
"MIT"
] | null | null | null | predict.py | pr-shukla/maddpg-keras | 8e3d1501f78ac2b78ee2c7053dc9299862386c17 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.keras.models import load_model
from matplotlib import animation
dt = 0.4
v = 1.0
ve = 1.2
#Dimension of State Space for single agent
dim_agent_state = 5
num_agents = 3
#Dimension of State Space
dim_state = d... | 26.839024 | 95 | 0.626136 | import numpy as np
import tensorflow as tf
from tensorflow.keras import layers
import matplotlib.pyplot as plt
import math
from tensorflow.keras.models import load_model
from matplotlib import animation
from env_predict import *
from buffer import *
from model import *
from noise import *
dt = 0.4
v = 1... | 0 | 0 | 0 | 0 | 0 | 662 | 0 | 3 | 209 |
62eb9db8c4f68adc489a91c82ddfa41ecb1db6aa | 919 | py | Python | question_2/data_for_analysis/main.py | juliuskrahn/media-analysis-climate-change | a31834fe92e3c13f42f9c446f720c8e173cd4e12 | [
"MIT"
] | 1 | 2021-11-09T10:04:59.000Z | 2021-11-09T10:04:59.000Z | question_2/data_for_analysis/main.py | juliuskrahn/media-analysis-climate-change | a31834fe92e3c13f42f9c446f720c8e173cd4e12 | [
"MIT"
] | null | null | null | question_2/data_for_analysis/main.py | juliuskrahn/media-analysis-climate-change | a31834fe92e3c13f42f9c446f720c8e173cd4e12 | [
"MIT"
] | null | null | null | """Load article sample (1%) into spreadsheet for manual content analysis"""
if __name__ == "__main__":
main()
| 31.689655 | 98 | 0.618063 | """Load article sample (1%) into spreadsheet for manual content analysis"""
import pandas as pd
import utils
from question_1.is_about_climate_change_sql_statement import is_about_climate_change_sql_statement
import os.path
def main():
if not os.path.isdir("output"):
os.mkdir("output")
for publisher ... | 0 | 0 | 0 | 0 | 0 | 632 | 0 | 59 | 111 |
bfc6f72eba9b045c2ed844c9865387f1e8e14d5d | 8,036 | py | Python | BE_PESCAO/philipp_plot.py | srio/shadow3-scripts | 10712641333c29ca9854e9cc60d86cb321f3762b | [
"MIT"
] | 1 | 2019-10-30T10:06:15.000Z | 2019-10-30T10:06:15.000Z | BE_PESCAO/philipp_plot.py | srio/shadow3-scripts | 10712641333c29ca9854e9cc60d86cb321f3762b | [
"MIT"
] | null | null | null | BE_PESCAO/philipp_plot.py | srio/shadow3-scripts | 10712641333c29ca9854e9cc60d86cb321f3762b | [
"MIT"
] | null | null | null | import numpy
from srxraylib.plot.gol import plot
import scipy.constants as codata
import xraylib
if __name__ == "__main__":
do_calculate_spectrum = True
diamond_thickness_in_mm = 0.8
outfile = "spectrumE.dat"
rho = 1.848
if do_calculate_spectrum:
energy, flux = create_spectrum()
... | 37.551402 | 123 | 0.62556 | import numpy
from srxraylib.plot.gol import plot
import scipy.constants as codata
import xraylib
def create_spectrum():
#
# script to make the calculations (created by XOPPY:undulator_spectrum)
#
from orangecontrib.xoppy.util.xoppy_undulators import xoppy_calc_undulator_spectrum
energy, flux, s... | 0 | 0 | 0 | 0 | 0 | 3,519 | 0 | 0 | 92 |
39bdcd851d1e101d6ce64bed3b83cb9b64c547f3 | 1,955 | py | Python | examples/get_bitmex_data.py | mstumberger/Quantdom | 2649aba90c741618a75900691480ddb720c461f4 | [
"Apache-2.0"
] | 1 | 2018-10-04T17:10:40.000Z | 2018-10-04T17:10:40.000Z | examples/get_bitmex_data.py | mstumberger/Quantdom | 2649aba90c741618a75900691480ddb720c461f4 | [
"Apache-2.0"
] | null | null | null | examples/get_bitmex_data.py | mstumberger/Quantdom | 2649aba90c741618a75900691480ddb720c461f4 | [
"Apache-2.0"
] | null | null | null | import requests
import math
import pandas as pd
from datetime import datetime
from datetime import timedelta
import requests
interval = 1
symbol = 'XBTUSD'
# get data from
timestamp_from = 1514761200
# till
timestamp_now = 1536530400
max_back_time = 0
max_bars = 10080
max_bars_time = ((interval * 60) * max_bars)
tim... | 31.031746 | 162 | 0.658312 | import requests
import math
import pandas as pd
from datetime import datetime
from datetime import timedelta
import requests
interval = 1
symbol = 'XBTUSD'
# get data from
timestamp_from = 1514761200
# till
timestamp_now = 1536530400
max_back_time = 0
max_bars = 10080
max_bars_time = ((interval * 60) * max_bars)
tim... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3ff79e66feee5dba038657ba5493972b25ff3838 | 934 | py | Python | funcionalidade/migrations/0001_initial.py | LeandroMelloo/curso_completo_django_rest_framework_alura | 3d319db12e955049361dd0d3673958a277778a84 | [
"Apache-2.0"
] | null | null | null | funcionalidade/migrations/0001_initial.py | LeandroMelloo/curso_completo_django_rest_framework_alura | 3d319db12e955049361dd0d3673958a277778a84 | [
"Apache-2.0"
] | null | null | null | funcionalidade/migrations/0001_initial.py | LeandroMelloo/curso_completo_django_rest_framework_alura | 3d319db12e955049361dd0d3673958a277778a84 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.6 on 2021-08-05 22:52
| 29.1875 | 95 | 0.524625 | # Generated by Django 3.2.6 on 2021-08-05 22:52
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Funcionalidade',
fields=[
('id', models.Aut... | 0 | 0 | 0 | 820 | 0 | 0 | 0 | 19 | 46 |
18b75a173943329d828fd3d13ff3565c010de306 | 9,545 | py | Python | Bayesian methods for Machine Learning/VAE.py | gesuwen/Machine-Learning | 02a93e4cc32a6707c018386f2f745f9937f94adc | [
"MIT"
] | null | null | null | Bayesian methods for Machine Learning/VAE.py | gesuwen/Machine-Learning | 02a93e4cc32a6707c018386f2f745f9937f94adc | [
"MIT"
] | null | null | null | Bayesian methods for Machine Learning/VAE.py | gesuwen/Machine-Learning | 02a93e4cc32a6707c018386f2f745f9937f94adc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# A Variational Autoencoder trained on the MNIST dataset.
import tensorflow as tf
import keras
import numpy as np
import matplotlib.pyplot as plt
from keras.layers import Input, Lambda, concatenate
from keras.models import Model
from keras import backend as K
from keras.datasets import mnist
fr... | 40.617021 | 142 | 0.647774 | # -*- coding: utf-8 -*-
# A Variational Autoencoder trained on the MNIST dataset.
import tensorflow as tf
import keras
import numpy as np
import matplotlib.pyplot as plt
from keras.layers import Input, Dense, Lambda, InputLayer, concatenate
from keras.models import Model, Sequential
from keras import backend as K
from... | 0 | 0 | 0 | 0 | 0 | 625 | 0 | 31 | 46 |
6f62159a43423725ef27c820b6b056f93c11c850 | 331 | py | Python | util/core.py | IRIS-Team/tchecker | 7f0b3218f8914ac3d96eadc8a7db1c2d23016503 | [
"MIT"
] | 17 | 2021-09-05T11:35:03.000Z | 2022-03-23T19:06:54.000Z | util/core.py | IRIS-Team/tchecker | 7f0b3218f8914ac3d96eadc8a7db1c2d23016503 | [
"MIT"
] | 2 | 2021-09-04T11:06:02.000Z | 2021-09-06T06:40:08.000Z | util/core.py | IRIS-Team/tchecker | 7f0b3218f8914ac3d96eadc8a7db1c2d23016503 | [
"MIT"
] | 5 | 2021-09-04T13:13:59.000Z | 2022-02-19T00:22:56.000Z | import json
colours = json.loads(open("theme/default.json").read()) | 25.461538 | 55 | 0.673716 | import json
colours = json.loads(open("theme/default.json").read())
class colours:
main = colours["main_color"]
sencondary = colours["sencondary"]
text = colours["text"]
darktext = colours["darktext"]
error = colours["error"]
def returnColor(string) -> str:
return f'{colours.main}{string}{col... | 0 | 0 | 0 | 156 | 0 | 61 | 0 | 0 | 46 |
6b1ed1845a4dbd185d9265d1d2db0d1dc492042a | 17,657 | py | Python | examples/demo_runner.py | funky23exe/habitat-sim | a72ba43593a57995972ba1521f6f7a20d122761c | [
"MIT"
] | null | null | null | examples/demo_runner.py | funky23exe/habitat-sim | a72ba43593a57995972ba1521f6f7a20d122761c | [
"MIT"
] | null | null | null | examples/demo_runner.py | funky23exe/habitat-sim | a72ba43593a57995972ba1521f6f7a20d122761c | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import habitat_sim
_barrier = None
| 40.497706 | 103 | 0.607408 | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import multiprocessing
import os
import random
import time
from enum import Enum
import numpy as np
from PIL import Image
from set... | 0 | 60 | 0 | 16,931 | 0 | 0 | 0 | 117 | 334 |
0c25ee0e646d54847337890d8e0fcb21c9e410f2 | 516 | py | Python | Util.py | WhatsFish/txt2json | 7fa998031a0901bf914f3e3268ce31c3b3894de2 | [
"MIT"
] | null | null | null | Util.py | WhatsFish/txt2json | 7fa998031a0901bf914f3e3268ce31c3b3894de2 | [
"MIT"
] | null | null | null | Util.py | WhatsFish/txt2json | 7fa998031a0901bf914f3e3268ce31c3b3894de2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 17 15:05:43 2020
@author: lihaoyang03
"""
| 17.2 | 35 | 0.587209 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 17 15:05:43 2020
@author: lihaoyang03
"""
def asc_sort(ages):
list.sort(ages)
return ages;
def desc_sort(ages):
list.sort(ages,reverse = True)
return ages;
def test_asc_sort(ages):
for i in range(len(ages)-1):
if ages[i... | 0 | 0 | 0 | 0 | 0 | 305 | 0 | 0 | 91 |
9893ddee6bbb747785141d0ec8f728428c20fbdd | 2,074 | py | Python | santa.py | alexander-travov/synchro | 74856e68bedfb2680ae4f2af191cb8220412bbde | [
"MIT"
] | null | null | null | santa.py | alexander-travov/synchro | 74856e68bedfb2680ae4f2af191cb8220412bbde | [
"MIT"
] | null | null | null | santa.py | alexander-travov/synchro | 74856e68bedfb2680ae4f2af191cb8220412bbde | [
"MIT"
] | null | null | null | from sync_utils import Semaphore, Barrier, watch
SANTA = Semaphore(0)
NUM_DEERS = 0
DEER_MUTEX = Semaphore(1)
SLEDGE = Semaphore(0)
SLEDGE_READY = Semaphore(0)
BARRIER = Barrier(9)
NUM_ELVES = 0
ELF_MUTEX = Semaphore(1)
ELF_MULTIPLEX = Semaphore(3)
HELP = Semaphore(0)
watch(main)
| 20.74 | 57 | 0.575699 | import sys
import time
import random
from sync_utils import Thread, Semaphore, Barrier, watch
SANTA = Semaphore(0)
NUM_DEERS = 0
DEER_MUTEX = Semaphore(1)
SLEDGE = Semaphore(0)
SLEDGE_READY = Semaphore(0)
BARRIER = Barrier(9)
NUM_ELVES = 0
ELF_MUTEX = Semaphore(1)
ELF_MULTIPLEX = Semaphore(3)
HELP = Semaphore(0)
... | 0 | 0 | 0 | 0 | 0 | 1,646 | 0 | -21 | 158 |
15be091dc287f310c631199352d615a271f2d3a6 | 3,126 | py | Python | axfr-test.py | internetwache/Python-AXFR-Test | 626c27d46b1f2f7fa76648cb771d48bc1f9fd9a3 | [
"MIT"
] | 52 | 2015-03-03T13:52:19.000Z | 2022-01-06T03:37:50.000Z | axfr-test.py | codingo/Python-AXFR-Test | 3c78829c8884ebcb4861e3237f756a1b21e41862 | [
"MIT"
] | null | null | null | axfr-test.py | codingo/Python-AXFR-Test | 3c78829c8884ebcb4861e3237f756a1b21e41862 | [
"MIT"
] | 25 | 2015-03-29T12:35:28.000Z | 2022-01-15T21:43:52.000Z | #!/usr/bin/python
import dns.resolver
import dns.query
import sys
INPUTFILE = sys.stdin
OUTPUTFILE = sys.stdout
LOGFILE = sys.stderr
PROCESSES = 20
if __name__ == '__main__':
main()
| 30.647059 | 141 | 0.633397 | #!/usr/bin/python
import argparse
import dns.resolver
import dns.query
import dns.zone
import os
import sys
from multiprocessing import Pool
INPUTFILE = sys.stdin
OUTPUTFILE = sys.stdout
LOGFILE = sys.stderr
PROCESSES = 20
def checkaxfr(domain):
domain = domain.strip()
try:
ns_query = dns.resolver.query(doma... | 0 | 0 | 0 | 0 | 0 | 2,818 | 0 | -13 | 135 |
4e2d51086f3f82db4205166399a4a1197e55e89d | 1,226 | py | Python | data_utils/convert_imgs_to_jpg.py | sun-yitao/GrabAIChallenge | 05946339e5a478216d7a9234e29e9bd7af5b3492 | [
"MIT"
] | 10 | 2019-07-05T05:28:30.000Z | 2020-09-15T02:47:16.000Z | data_utils/convert_imgs_to_jpg.py | sun-yitao/GrabAIChallenge | 05946339e5a478216d7a9234e29e9bd7af5b3492 | [
"MIT"
] | 6 | 2019-11-18T12:59:22.000Z | 2022-02-10T00:23:00.000Z | data_utils/convert_imgs_to_jpg.py | sun-yitao/GrabAIChallenge | 05946339e5a478216d7a9234e29e9bd7af5b3492 | [
"MIT"
] | 2 | 2019-07-17T15:12:14.000Z | 2020-04-15T19:06:41.000Z | """Script to convert non-jpgs in a folder to jpg"""
from pathlib import Path
cwd = Path.cwd()
DATA_DIR = cwd.parent / 'data' / 'stanford-car-dataset-by-classes-folder' / 'car_data' / 'new_data'
if __name__ == '__main__':
convert_png_to_jpg() | 28.511628 | 99 | 0.556281 | """Script to convert non-jpgs in a folder to jpg"""
import os
from pathlib import Path
from PIL import Image
from glob import glob
from tqdm import tqdm
from shutil import move
cwd = Path.cwd()
DATA_DIR = cwd.parent / 'data' / 'stanford-car-dataset-by-classes-folder' / 'car_data' / 'new_data'
def convert_png_to_jpg... | 0 | 0 | 0 | 0 | 0 | 829 | 0 | -10 | 156 |
f06408f512996c1c23fa1eb9aa58df5911971391 | 3,169 | py | Python | test_learnable_histogram.py | donikv/IlluminationBase | 4aade52bb8a1065f10b94ffda09645a681d8160c | [
"MIT"
] | null | null | null | test_learnable_histogram.py | donikv/IlluminationBase | 4aade52bb8a1065f10b94ffda09645a681d8160c | [
"MIT"
] | null | null | null | test_learnable_histogram.py | donikv/IlluminationBase | 4aade52bb8a1065f10b94ffda09645a681d8160c | [
"MIT"
] | null | null | null | import learnable_histogram
import TauDataset
import numpy as np
import tensorflow as tf
import losses
import histogram
import visualizer
import CubeDataset
from report import print_report, error_statistics
mode = 'rb'
# path = "/media/donik/Disk/intel_tau/paths_field.txt"
# imgs = load_image_names(path, base_path='... | 34.075269 | 116 | 0.646261 | import learnable_histogram
import TauDataset
import data_processing as dp
import numpy as np
import tensorflow as tf
import losses
import histogram
import visualizer
import CubeDataset
from report import print_report, error_statistics
def load_image_names(path, base_path):
names = np.loadtxt(path, dtype="str")
... | 0 | 0 | 0 | 0 | 0 | 574 | 0 | 7 | 68 |
04cbaef966fa6fa70ab44438f50e64c3a5e06b8e | 251 | py | Python | output/models/nist_data/list_pkg/any_uri/schema_instance/nistschema_sv_iv_list_any_uri_max_length_3_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/list_pkg/any_uri/schema_instance/nistschema_sv_iv_list_any_uri_max_length_3_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/list_pkg/any_uri/schema_instance/nistschema_sv_iv_list_any_uri_max_length_3_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.list_pkg.any_uri.schema_instance.nistschema_sv_iv_list_any_uri_max_length_3_xsd.nistschema_sv_iv_list_any_uri_max_length_3 import NistschemaSvIvListAnyUriMaxLength3
__all__ = [
"NistschemaSvIvListAnyUriMaxLength3",
]
| 41.833333 | 193 | 0.89243 | from output.models.nist_data.list_pkg.any_uri.schema_instance.nistschema_sv_iv_list_any_uri_max_length_3_xsd.nistschema_sv_iv_list_any_uri_max_length_3 import NistschemaSvIvListAnyUriMaxLength3
__all__ = [
"NistschemaSvIvListAnyUriMaxLength3",
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ad6f07e3a152dcb07c862494d1fbbcad0a6bcced | 3,579 | py | Python | flaskJSONRPCServer/example/mergeFlaskApp.py | byaka/flaskJSONRPCServer | 328e88c7358e8ce87cd8c56a2db22b0c43e9661d | [
"Apache-2.0"
] | 2 | 2017-04-12T05:54:38.000Z | 2019-10-09T15:56:18.000Z | flaskJSONRPCServer/example/mergeFlaskApp.py | byaka/flaskJSONRPCServer | 328e88c7358e8ce87cd8c56a2db22b0c43e9661d | [
"Apache-2.0"
] | 160 | 2015-04-24T09:39:08.000Z | 2019-10-13T15:27:29.000Z | flaskJSONRPCServer/example/mergeFlaskApp.py | byaka/flaskJSONRPCServer | 328e88c7358e8ce87cd8c56a2db22b0c43e9661d | [
"Apache-2.0"
] | 2 | 2016-02-26T13:20:02.000Z | 2021-10-05T04:05:04.000Z | # -*- coding: utf-8 -*-
import sys, time, random
#FLASK
from flask import Flask, request
from flaskJSONRPCServer import flaskJSONRPCServer
echo._alias='helloworld' #setting alias for method
app=Flask(__name__)
app2=Flask(__name__)
if __name__=='__main__':
print 'Running api..'
# Creating instance of server
... | 42.105882 | 244 | 0.686225 | # -*- coding: utf-8 -*-
import sys, time, random
#FLASK
from flask import Flask, request
from flaskJSONRPCServer import flaskJSONRPCServer
def echo(data='Hello world!'):
# Simply echo
return data
echo._alias='helloworld' #setting alias for method
def stats(_connection=None):
#return server's speed stats
... | 0 | 482 | 0 | 0 | 0 | 634 | 0 | 0 | 182 |
2971e7f8d7109db83925545f9423d8ef90054149 | 594 | py | Python | src/python/pants/core/util_rules/distdir_test.py | viktortnk/pants | 54c98206de5ac9aadfe26d83175f472941be6c7d | [
"Apache-2.0"
] | 1 | 2020-06-13T22:01:39.000Z | 2020-06-13T22:01:39.000Z | src/python/pants/core/util_rules/distdir_test.py | viktortnk/pants | 54c98206de5ac9aadfe26d83175f472941be6c7d | [
"Apache-2.0"
] | null | null | null | src/python/pants/core/util_rules/distdir_test.py | viktortnk/pants | 54c98206de5ac9aadfe26d83175f472941be6c7d | [
"Apache-2.0"
] | 2 | 2020-05-18T18:43:11.000Z | 2020-05-19T02:47:47.000Z | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
| 34.941176 | 96 | 0.747475 | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pathlib import Path
import pytest
from pants.core.util_rules.distdir import DistDir, InvalidDistDir, validate_distdir
def test_distdir():
buildroot = Path("/buildroot")
as... | 0 | 0 | 0 | 0 | 0 | 313 | 0 | 57 | 92 |
17b0a6e850d3e4025bc339029a459d15ea6ce799 | 9,504 | py | Python | brainstat/tests/test_f_test.py | rmarkello/BrainStat | f34ffa01274aabf411feb801a3ea1869f8a22d11 | [
"BSD-3-Clause"
] | null | null | null | brainstat/tests/test_f_test.py | rmarkello/BrainStat | f34ffa01274aabf411feb801a3ea1869f8a22d11 | [
"BSD-3-Clause"
] | null | null | null | brainstat/tests/test_f_test.py | rmarkello/BrainStat | f34ffa01274aabf411feb801a3ea1869f8a22d11 | [
"BSD-3-Clause"
] | null | null | null |
# test data *pkl consists of slm1* and slm2* keys
# slm1* variables will be assigned to slm1 dictionary, and slm2* to the slm2 dict.
| 35.729323 | 86 | 0.59838 | import numpy as np
import pickle
from .testutil import datadir
from brainstat.stats.SLM import SLM, f_test
from brainstat.stats.terms import Term
def dummy_test(infile, expfile):
# load input test data
ifile = open(infile, "br")
idic = pickle.load(ifile)
ifile.close()
slm1 = SLM(Term(1), Term(1)... | 0 | 0 | 0 | 0 | 0 | 8,911 | 0 | 36 | 409 |