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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
130af6253c40f5dbc7c8534cd07943a516825302 | 1,371 | py | Python | LeetCode/Python/725.split-linked-list-in-parts.py | Alfonsxh/LeetCode-Challenge-python | e93f93fd58d1945708d6aa300dcbcd17d0708274 | [
"MIT"
] | null | null | null | LeetCode/Python/725.split-linked-list-in-parts.py | Alfonsxh/LeetCode-Challenge-python | e93f93fd58d1945708d6aa300dcbcd17d0708274 | [
"MIT"
] | null | null | null | LeetCode/Python/725.split-linked-list-in-parts.py | Alfonsxh/LeetCode-Challenge-python | e93f93fd58d1945708d6aa300dcbcd17d0708274 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=725 lang=python3
#
# [725] Split Linked List in Parts
#
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
from LeetCode.Python.BaseListNode import MakeListNodes, PrintListNode
if __name__ == '__main__':
fo... | 24.927273 | 99 | 0.553611 | #
# @lc app=leetcode id=725 lang=python3
#
# [725] Split Linked List in Parts
#
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
from typing import List
from LeetCode.Python.BaseListNode import MakeListNodes, PrintListNode, ListNode
... | 219 | 0 | 0 | 799 | 0 | 0 | 0 | 12 | 45 |
ae0b905de1a5aff9d5290e5c6fdc49770f3b4275 | 775 | py | Python | digsby/src/gui/helpdigsby.py | ifwe/digsby | f5fe00244744aa131e07f09348d10563f3d8fa99 | [
"Python-2.0"
] | 35 | 2015-08-15T14:32:38.000Z | 2021-12-09T16:21:26.000Z | digsby/src/gui/helpdigsby.py | niterain/digsby | 16a62c7df1018a49eaa8151c0f8b881c7e252949 | [
"Python-2.0"
] | 4 | 2015-09-12T10:42:57.000Z | 2017-02-27T04:05:51.000Z | digsby/src/gui/helpdigsby.py | niterain/digsby | 16a62c7df1018a49eaa8151c0f8b881c7e252949 | [
"Python-2.0"
] | 15 | 2015-07-10T23:58:07.000Z | 2022-01-23T22:16:33.000Z | __all__ = ['show_research_popup',
'show_research_popup_once']
HEADER = _('Keep Digsby Free')
MINOR = _("Digsby will use your computer's free time using it to conduct both free and paid research.")
| 25.833333 | 103 | 0.669677 | __all__ = ['show_research_popup',
'show_research_popup_once']
HEADER = _('Keep Digsby Free')
MINOR = _("Digsby will use your computer's free time using it to conduct both free and paid research.")
def _on_options():
from gui.pref import prefsdialog
prefsdialog.show('helpdigsby')
def show_research_... | 0 | 0 | 0 | 0 | 0 | 496 | 0 | 0 | 69 |
1d4a72c9d443a73d6b3fc942791c34ab8a38e932 | 8,838 | py | Python | src/gridlock.py | uxai/gridlock | e91f82b5580d2a38f36225ec1c1c427bbda9b2a0 | [
"MIT"
] | 2 | 2022-02-17T15:14:53.000Z | 2022-03-23T14:58:16.000Z | src/gridlock.py | uxai/gridlock | e91f82b5580d2a38f36225ec1c1c427bbda9b2a0 | [
"MIT"
] | 1 | 2022-02-17T23:46:54.000Z | 2022-02-17T23:46:54.000Z | src/gridlock.py | uxai/gridlock | e91f82b5580d2a38f36225ec1c1c427bbda9b2a0 | [
"MIT"
] | 1 | 2022-02-17T18:22:38.000Z | 2022-02-17T18:22:38.000Z | '''
github.com/uxai/gridlock
Thanks for your interest in GRIDLOCK
I plan to do slow improvements here and there on methods, or enabling files in the near future.
If you have suggestions or improvements, let me know! I'm new to Python so I'm still learning ^^;
TABLE OF CONTENTS
----------------------------------------... | 39.106195 | 496 | 0.540959 | '''
github.com/uxai/gridlock
Thanks for your interest in GRIDLOCK
I plan to do slow improvements here and there on methods, or enabling files in the near future.
If you have suggestions or improvements, let me know! I'm new to Python so I'm still learning ^^;
TABLE OF CONTENTS
----------------------------------------... | 20 | 0 | 0 | 0 | 0 | 6,825 | 0 | -19 | 223 |
53ea1da97333c44e90a79c42f1383a29edf00c00 | 2,300 | py | Python | keystoneclient/v2_0/tokens.py | jamielennox/python-keystoneclient | a1bc48c0fc475db6bca761a9023c35adab740dab | [
"Apache-1.1"
] | 1 | 2020-12-18T01:07:30.000Z | 2020-12-18T01:07:30.000Z | keystoneclient/v2_0/tokens.py | jamielennox/python-keystoneclient | a1bc48c0fc475db6bca761a9023c35adab740dab | [
"Apache-1.1"
] | null | null | null | keystoneclient/v2_0/tokens.py | jamielennox/python-keystoneclient | a1bc48c0fc475db6bca761a9023c35adab740dab | [
"Apache-1.1"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 34.848485 | 78 | 0.616087 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 0 | 1,193 | 0 | 421 | 0 | 0 | 0 | 21 | 91 |
52763570d82973690121027426a1bf6f68788156 | 2,739 | py | Python | puzzler/puzzles/quasipolytwigs123.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | null | null | null | puzzler/puzzles/quasipolytwigs123.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | null | null | null | puzzler/puzzles/quasipolytwigs123.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | 1 | 2022-01-02T16:54:14.000Z | 2022-01-02T16:54:14.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# $Id$
# Author: David Goodger <goodger@python.org>
# Copyright: (C) 1998-2015 by David J. Goodger
# License: GPL 2 (see __init__.py)
"""
Concrete quasi-polytrigs (order 1-3) puzzles.
"""
| 23.016807 | 79 | 0.630522 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# $Id$
# Author: David Goodger <goodger@python.org>
# Copyright: (C) 1998-2015 by David J. Goodger
# License: GPL 2 (see __init__.py)
"""
Concrete quasi-polytrigs (order 1-3) puzzles.
"""
from puzzler.puzzles.polytwigs import (
QuasiPolytwigs123, OneSidedQuasiPolytwi... | 0 | 0 | 0 | 2,244 | 0 | 0 | 0 | 68 | 184 |
2237a8eabb975d8abd20c532c714a35f759dadda | 1,119 | py | Python | examples/qm8/qm8_MPNN.py | n3011/deepchem | c316d998c462ce01032f0dae883856b400ea4765 | [
"MIT"
] | 14 | 2017-10-12T23:47:23.000Z | 2022-02-09T13:13:51.000Z | examples/qm8/qm8_MPNN.py | n3011/deepchem | c316d998c462ce01032f0dae883856b400ea4765 | [
"MIT"
] | 2 | 2017-08-02T20:35:13.000Z | 2017-08-10T21:17:31.000Z | examples/qm8/qm8_MPNN.py | n3011/deepchem | c316d998c462ce01032f0dae883856b400ea4765 | [
"MIT"
] | 4 | 2017-06-04T05:24:47.000Z | 2021-04-20T13:17:15.000Z | """
Script that trains MPNN models on qm8 dataset.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import numpy as np
np.random.seed(123)
import tensorflow as tf
tf.set_random_seed(123)
import deepchem as dc
# Load QM8 dataset
tasks, datasets, transfor... | 22.836735 | 76 | 0.769437 | """
Script that trains MPNN models on qm8 dataset.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import numpy as np
np.random.seed(123)
import tensorflow as tf
tf.set_random_seed(123)
import deepchem as dc
# Load QM8 dataset
tasks, datasets, transfor... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
089c178f8dd9e51931d2328bd36cb9b1d0fed1ba | 12,608 | py | Python | pysembles/Metrics.py | sbuschjaeger/Pysembles | 7e69b0975a7d4373242c7026ade6c5fdbad4fe67 | [
"MIT"
] | null | null | null | pysembles/Metrics.py | sbuschjaeger/Pysembles | 7e69b0975a7d4373242c7026ade6c5fdbad4fe67 | [
"MIT"
] | null | null | null | pysembles/Metrics.py | sbuschjaeger/Pysembles | 7e69b0975a7d4373242c7026ade6c5fdbad4fe67 | [
"MIT"
] | null | null | null | import torch
import torchvision.transforms as transforms
'''
Some common metrics and helper functions.
TODO: Add detailed documentation for each function
'''
# def diversity(model, x, y):
# # This is basically a copy/paste from the GNCLClasifier regularizer, which can also be used for
# # other classifier. ... | 36.651163 | 134 | 0.597081 | import numpy as np
import pandas as pd
import torch
import scipy
import torch
from torch import nn
from torch.autograd import Variable
import torchvision
import torchvision.transforms as transforms
from sklearn.metrics import make_scorer, accuracy_score
from pysembles.Utils import TransformTensorDataset
'''
Some co... | 0 | 0 | 0 | 0 | 0 | 4,471 | 0 | 50 | 339 |
84c690c6ba318b5e4b00c8827552254d8ab2e7a5 | 1,147 | py | Python | src/common/errors.py | sUeharaE4/gitlab-dashboard | 4f86cfe21e625badb82086e5ba10f4b532ebb2d1 | [
"MIT"
] | null | null | null | src/common/errors.py | sUeharaE4/gitlab-dashboard | 4f86cfe21e625badb82086e5ba10f4b532ebb2d1 | [
"MIT"
] | 1 | 2022-01-02T01:31:06.000Z | 2022-01-02T01:31:06.000Z | src/common/errors.py | sUeharaE4/gitlab-dashboard | 4f86cfe21e625badb82086e5ba10f4b532ebb2d1 | [
"MIT"
] | null | null | null | """Provide Exception classes."""
| 29.410256 | 96 | 0.63993 | """Provide Exception classes."""
from dataclasses import dataclass
from pathlib import Path
from typing import Any
@dataclass(frozen=True)
class SettingNotFoundError(Exception):
"""Error class for missing config file."""
conf_path: Path
sample_conf_path: Path
def __str__(self) -> str:
"""Cre... | 0 | 984 | 0 | 0 | 0 | 0 | 0 | 16 | 112 |
11e8a204b2ea1c7fb3c512dd2cf629e76b9ae908 | 820 | py | Python | migration/migrator/migrations/system/20190708100715_add_worker_to_submitty_config.py | elihschiff/Submitty | 8b980997b6f1dfcd73eb4cf4cca43398e67f96dc | [
"BSD-3-Clause"
] | 411 | 2016-06-14T20:52:25.000Z | 2022-03-31T21:20:25.000Z | migration/migrator/migrations/system/20190708100715_add_worker_to_submitty_config.py | KaelanWillauer/Submitty | cf9b6ceda15ec0a661e2ca81ea7864790094c64a | [
"BSD-3-Clause"
] | 5,730 | 2016-05-23T21:04:32.000Z | 2022-03-31T10:08:06.000Z | migration/migrator/migrations/system/20190708100715_add_worker_to_submitty_config.py | KaelanWillauer/Submitty | cf9b6ceda15ec0a661e2ca81ea7864790094c64a | [
"BSD-3-Clause"
] | 423 | 2016-09-22T21:11:30.000Z | 2022-03-29T18:55:28.000Z | """
Migration for the Submitty system.
Adds bool to specify if the machine is a worker to Submitty.config
"""
# no need for down as email_enabled is not used in previous builds
| 28.275862 | 102 | 0.692683 | """
Migration for the Submitty system.
Adds bool to specify if the machine is a worker to Submitty.config
"""
from pathlib import Path
import json
import os
def up(config):
submitty_json = str(Path(config.submitty['submitty_install_dir'], 'config', 'submitty.json'))
submitty_conf = str(Path(config.submitty['s... | 0 | 0 | 0 | 0 | 0 | 549 | 0 | -19 | 111 |
499f8ef7663c3caef91b76d2f042d762e5ed0777 | 38,795 | py | Python | hoomd/hpmc/util.py | kmoskovtsev/HOOMD-Blue-fork | 99560563a5ba9e082b513764bae51a84f48fdc70 | [
"BSD-3-Clause"
] | null | null | null | hoomd/hpmc/util.py | kmoskovtsev/HOOMD-Blue-fork | 99560563a5ba9e082b513764bae51a84f48fdc70 | [
"BSD-3-Clause"
] | null | null | null | hoomd/hpmc/util.py | kmoskovtsev/HOOMD-Blue-fork | 99560563a5ba9e082b513764bae51a84f48fdc70 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2009-2017 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause License.
R""" HPMC utilities
"""
from __future__ import print_function
from __future__ import division
# If numpy is unavailable, some utilities will not work
try:
imp... | 44.643268 | 147 | 0.577007 | # Copyright (c) 2009-2017 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause License.
R""" HPMC utilities
"""
from __future__ import print_function
from __future__ import division
# If numpy is unavailable, some utilities will not work
try:
imp... | 0 | 0 | 0 | 28,984 | 0 | 6,355 | 0 | -21 | 267 |
78e137cacf618952ef009e93d9861c3cfb18fd96 | 186 | py | Python | server/algorithms/__init__.py | young-geng/ResumeAnalytics | 3bbe7ce2c6620ceeaa39b6c6feba1f080b5210d2 | [
"MIT"
] | 3 | 2015-02-18T04:15:35.000Z | 2018-03-16T14:22:35.000Z | server/algorithms/__init__.py | young-geng/ResumeAnalytics | 3bbe7ce2c6620ceeaa39b6c6feba1f080b5210d2 | [
"MIT"
] | null | null | null | server/algorithms/__init__.py | young-geng/ResumeAnalytics | 3bbe7ce2c6620ceeaa39b6c6feba1f080b5210d2 | [
"MIT"
] | 2 | 2015-02-10T07:03:46.000Z | 2018-07-04T07:49:33.000Z | #!/usr/bin/env python
if __name__ == '__main__':
print "Algorithm module!"
| 18.6 | 31 | 0.741935 | #!/usr/bin/env python
from cos_sim import *
from topic_model import *
from vectorizer import *
from algorithm_wrapper import *
if __name__ == '__main__':
print "Algorithm module!"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 88 |
879b85dbe02c5081f69ff78ce76136bf2a759c9a | 6,023 | py | Python | hive/utils/post.py | dpays/hivemind | 362d7d13c735056f2c8ed8f65b20f2384131779f | [
"MIT"
] | null | null | null | hive/utils/post.py | dpays/hivemind | 362d7d13c735056f2c8ed8f65b20f2384131779f | [
"MIT"
] | null | null | null | hive/utils/post.py | dpays/hivemind | 362d7d13c735056f2c8ed8f65b20f2384131779f | [
"MIT"
] | null | null | null | """Methods for normalizing dpayd post metadata."""
#pylint: disable=line-too-long
import math
import ujson as json
from funcy.seqs import first
from hive.utils.normalize import bbd_amount, rep_log10, safe_img_url, parse_time, utc_timestamp
def post_basic(post):
"""Basic post normalization: json-md, tags, and fl... | 35.017442 | 149 | 0.624772 | """Methods for normalizing dpayd post metadata."""
#pylint: disable=line-too-long
import math
import ujson as json
from funcy.seqs import first
from hive.utils.normalize import bbd_amount, rep_log10, safe_img_url, parse_time, utc_timestamp
def post_basic(post):
"""Basic post normalization: json-md, tags, and fl... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a28e2c96b904e1d6354829c89351b0850d9ceef7 | 941 | py | Python | action-demo_dev_kit.py | dixon415/snips-skill-weather-dixon | 95fb1b5a493e6c938f949eb13f1a5af46c932a30 | [
"MIT"
] | 7 | 2019-03-13T21:11:29.000Z | 2020-03-25T10:54:30.000Z | action-demo_dev_kit.py | dixon415/snips-skill-weather-dixon | 95fb1b5a493e6c938f949eb13f1a5af46c932a30 | [
"MIT"
] | null | null | null | action-demo_dev_kit.py | dixon415/snips-skill-weather-dixon | 95fb1b5a493e6c938f949eb13f1a5af46c932a30 | [
"MIT"
] | 16 | 2019-04-04T11:08:09.000Z | 2020-06-22T04:29:34.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from RelaySwitch import RelaySwitch
from SHT31 import SHT31
from SnipsClients import SnipsMPU
VERSION = '0.3.0'
CONFIG_INI = 'config.ini'
I18N_DIR = 'assets/i18n'
config = SnipsConfigParser.read_configuration_file(CONFIG_INI).get('global')
MQTT_ADDR_HOST = str(config.g... | 27.676471 | 76 | 0.736451 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from snipsTools import *
from RelaySwitch import RelaySwitch
from SHT31 import SHT31
from SnipsClients import SnipsMPU
VERSION = '0.3.0'
CONFIG_INI = 'config.ini'
I18N_DIR = 'assets/i18n'
config = SnipsConfigParser.read_configuration_file(CONFIG_INI).get('global')
MQT... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 23 |
b74a6cd392d404857e901e20d2cc29c8e92dc23a | 556 | py | Python | rtt.py | afsimoneau/cca-test-suite | 8e1a249ae66fd4e58a196c6280cd8c7a09094d32 | [
"MIT"
] | 1 | 2020-09-17T14:59:44.000Z | 2020-09-17T14:59:44.000Z | rtt.py | afsimoneau/cca-test-suite | 8e1a249ae66fd4e58a196c6280cd8c7a09094d32 | [
"MIT"
] | null | null | null | rtt.py | afsimoneau/cca-test-suite | 8e1a249ae66fd4e58a196c6280cd8c7a09094d32 | [
"MIT"
] | null | null | null | import os, sys, re
lines = []
with os.popen("tshark -r "+sys.argv[1]+" -T fields -e tcp.analysis.ack_rtt") as sharky:
for line in sharky:
lines.append(line)
cleanList = []
for dirty in lines:
temp = re.sub("[^\d.]","",dirty)
if temp!="":
cleanList.append(temp)#filtering
numbers = list(map(... | 26.47619 | 92 | 0.669065 | import os,sys,subprocess,re
lines = []
with os.popen("tshark -r "+sys.argv[1]+" -T fields -e tcp.analysis.ack_rtt") as sharky:
for line in sharky:
lines.append(line)
cleanList = []
for dirty in lines:
temp = re.sub("[^\d.]","",dirty)
if temp!="":
cleanList.append(temp)#filtering
numbers = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 0 |
16f327356cfca43f23896eb8064eb576c3a8a895 | 397 | py | Python | app.py | BrunoCostaPrado/Hope | eb97359d7939f8edeaade0a8a9880a8bd600f38b | [
"MIT"
] | 2 | 2021-11-27T19:46:36.000Z | 2021-11-28T02:41:05.000Z | app.py | BrunoCostaPrado/Hope | eb97359d7939f8edeaade0a8a9880a8bd600f38b | [
"MIT"
] | null | null | null | app.py | BrunoCostaPrado/Hope | eb97359d7939f8edeaade0a8a9880a8bd600f38b | [
"MIT"
] | null | null | null | from flask import Flask
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
if __name__ == "__main__":
app.run(debug=True)
| 20.894737 | 58 | 0.702771 | from flask import Flask, render_template, request, jsonify
from flask_cors import CORS
from Hope import get_response
app = Flask(__name__)
CORS(app)
@app.get("/")
@app.post("/predict")
def predict():
text = request.get_json().get("message")
response = get_response(text)
message = {"answer": response}
... | 0 | 171 | 0 | 0 | 0 | 0 | 0 | 43 | 45 |
570cfc314b92388cc92855fea7600f5e8b1e443e | 11,600 | py | Python | q3/q3/drivers/ui/pyqt5.py | virtimus/makaronLab | 10b9be7d7d65d3da6219f929ea7070dd5fed3a81 | [
"0BSD"
] | 2 | 2021-03-16T05:48:36.000Z | 2021-10-11T01:55:48.000Z | q3/q3/drivers/ui/pyqt5.py | virtimus/makaronLab | 10b9be7d7d65d3da6219f929ea7070dd5fed3a81 | [
"0BSD"
] | null | null | null | q3/q3/drivers/ui/pyqt5.py | virtimus/makaronLab | 10b9be7d7d65d3da6219f929ea7070dd5fed3a81 | [
"0BSD"
] | 1 | 2021-03-16T05:48:39.000Z | 2021-03-16T05:48:39.000Z |
# PYQT
#from ...TabPanel import TabPanel
from ... import consts, prop, direction
#class IoNode:
# pass
| 34.017595 | 141 | 0.617931 |
# PYQT
import sys
#from ...TabPanel import TabPanel
import sip
from q3.ui.engine import qtw,qtc,qtg
from ... import consts, prop, direction
from ...ui import orientation, colors
from ...moduletype import ModuleType
from ...nodeiotype import NodeIoType
from ...q3vector import Q3Vector
from ...EventSignal import E... | 0 | 0 | 0 | 10,915 | 0 | 0 | 0 | 161 | 407 |
f59fc69e416729d04e24fc03394e44035e390f32 | 4,738 | py | Python | apps/project/views/project_views.py | ranyong1997/Sakura_Infinity | 700c3e8497077b266958f1d26525469d1f0cd87f | [
"MIT"
] | 1 | 2022-03-24T05:33:30.000Z | 2022-03-24T05:33:30.000Z | apps/project/views/project_views.py | ranyong1997/Sakura_Infinity | 700c3e8497077b266958f1d26525469d1f0cd87f | [
"MIT"
] | null | null | null | apps/project/views/project_views.py | ranyong1997/Sakura_Infinity | 700c3e8497077b266958f1d26525469d1f0cd87f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
| 33.132867 | 89 | 0.679401 | # -*- coding: utf-8 -*-
# 项目详情视图 类
from django.db.models import Q
from django.urls import reverse_lazy
from django.views.generic import CreateView, ListView, DetailView, UpdateView, DeleteView
from django.core.paginator import Paginator
from project.forms.project_from import ProjectUpdateForm, ProjectCreateForm
from ... | 276 | 0 | 0 | 4,096 | 0 | 0 | 0 | 198 | 316 |
6a33c7fbc4ce6df729c2f4f2c17b051f3f947bcd | 3,241 | py | Python | ddpg.py | clairecw/rlkit | 2aed5bb02678e0f291260d00f023298748c3e5fe | [
"MIT"
] | null | null | null | ddpg.py | clairecw/rlkit | 2aed5bb02678e0f291260d00f023298748c3e5fe | [
"MIT"
] | null | null | null | ddpg.py | clairecw/rlkit | 2aed5bb02678e0f291260d00f023298748c3e5fe | [
"MIT"
] | null | null | null | """
Example of running PyTorch implementation of DDPG on HalfCheetah.
"""
from rlkit.launchers.launcher_util import setup_logger
if __name__ == "__main__":
# noinspection PyTypeChecker
variant = dict(
algorithm_kwargs=dict(
num_epochs=1000,
num_eval_steps_per_epoch=5000,
... | 32.737374 | 76 | 0.69639 | """
Example of running PyTorch implementation of DDPG on HalfCheetah.
"""
import copy
from gym.envs.mujoco import HalfCheetahEnv
from rlkit.data_management.env_replay_buffer import EnvReplayBuffer
from rlkit.envs.wrappers import NormalizedBoxEnv
from rlkit.exploration_strategies.base import (
PolicyWrappedWithExp... | 0 | 0 | 0 | 0 | 0 | 1,561 | 0 | 352 | 267 |
ca0941b999bfbf8b7035354ee3022a2f258995b6 | 2,083 | py | Python | binary_search.py | leiverandres/sorting-algos | 21b96770c05345efc6f923180a9ee4c2c4c9ca2e | [
"MIT"
] | null | null | null | binary_search.py | leiverandres/sorting-algos | 21b96770c05345efc6f923180a9ee4c2c4c9ca2e | [
"MIT"
] | null | null | null | binary_search.py | leiverandres/sorting-algos | 21b96770c05345efc6f923180a9ee4c2c4c9ca2e | [
"MIT"
] | null | null | null | import pyximport
pyximport.install(pyimport=True)
import time
import json
from utils import create_rand_array
if __name__ == '__main__':
methods = ['linear', 'binary_search']
# array_sizes = [10**x for x in range(1, 9)]
array_sizes = range(100000, 1000001, 50000)
run_times = 10
times = {x: {}... | 27.773333 | 65 | 0.566971 | import pyximport
pyximport.install(pyimport=True)
from random import randint
import time
import json
from utils import create_rand_array
def binary_search(arr, query):
low = -1 # arr[low] <= query
high = len(arr) # arr[high] > query
while high - low > 1:
mid = (high + low) // 2
if arr[m... | 0 | 0 | 0 | 0 | 0 | 912 | 0 | 5 | 114 |
c357849492ed125be61288bd251b8cf23c121f33 | 12,017 | py | Python | homeassistant/components/webostv/__init__.py | aomann/core | 5e71e7b775461cd4849c36075c6a1459a7d0ad22 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/webostv/__init__.py | aomann/core | 5e71e7b775461cd4849c36075c6a1459a7d0ad22 | [
"Apache-2.0"
] | 24 | 2021-11-11T03:58:57.000Z | 2022-03-31T06:24:13.000Z | homeassistant/components/webostv/__init__.py | aomann/core | 5e71e7b775461cd4849c36075c6a1459a7d0ad22 | [
"Apache-2.0"
] | null | null | null | """Support for LG webOS Smart TV."""
from __future__ import annotations
import json
import logging
import os
from pickle import loads
import sqlalchemy as db
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (ATTR_COMMAND, ATTR_ENTITY_ID, CONF_CUSTOMIZE, CONF_... | 31.375979 | 88 | 0.636848 | """Support for LG webOS Smart TV."""
from __future__ import annotations
import asyncio
from collections.abc import Callable
from contextlib import suppress
import json
import logging
import os
from pickle import loads
from typing import Any
from aiowebostv import WebOsClient, WebOsTvPairError
import sqlalchemy as db
... | 0 | 584 | 6,171 | 739 | 0 | 0 | 0 | 620 | 362 |
422849a3cba136af3e2c94c4c9bcdad9126bf4e9 | 1,198 | py | Python | old_and_simple_and_deprecated/xml_bez_daty_lub_celu_p33.py | mcjczapiewski/work | 2540afa6b18bf6ff92a7c07b16695035785c0dd8 | [
"MIT"
] | null | null | null | old_and_simple_and_deprecated/xml_bez_daty_lub_celu_p33.py | mcjczapiewski/work | 2540afa6b18bf6ff92a7c07b16695035785c0dd8 | [
"MIT"
] | null | null | null | old_and_simple_and_deprecated/xml_bez_daty_lub_celu_p33.py | mcjczapiewski/work | 2540afa6b18bf6ff92a7c07b16695035785c0dd8 | [
"MIT"
] | null | null | null | import os
import regex
import io
from natsort import natsort_keygen, natsorted
nkey = natsort_keygen()
for subdir, dirs, files in os.walk(
r"I:\INOWROCAW\DANE_IRON_MOUNTAIN\20190614\DBROWA BISKUPIA"
):
dirs.sort(key=nkey)
if not any(fname.upper().endswith(".XML") for fname in os.listdir(subdir)):
... | 38.645161 | 79 | 0.495826 | import os
import regex
import io
from natsort import natsort_keygen, natsorted
nkey = natsort_keygen()
for subdir, dirs, files in os.walk(
r"I:\INOWROCŁAW\DANE_IRON_MOUNTAIN\20190614\DĄBROWA BISKUPIA"
):
dirs.sort(key=nkey)
if not any(fname.upper().endswith(".XML") for fname in os.listdir(subdir)):
... | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fafca969cf2663ef2c1da62b9e4563c3318885a7 | 159 | py | Python | asios/kernel/fixup.py | Paolo-Maffei/retro | bf30cec3d82672eb2805392e77f3b21705129fc0 | [
"Unlicense"
] | 1 | 2022-02-12T19:35:39.000Z | 2022-02-12T19:35:39.000Z | asios/kernel/fixup.py | Paolo-Maffei/retro | bf30cec3d82672eb2805392e77f3b21705129fc0 | [
"Unlicense"
] | null | null | null | asios/kernel/fixup.py | Paolo-Maffei/retro | bf30cec3d82672eb2805392e77f3b21705129fc0 | [
"Unlicense"
] | null | null | null | Import("env")
env.Replace(LINKFLAGS = [fixLinkFlag(i) for i in env['LINKFLAGS']])
| 22.714286 | 67 | 0.641509 | Import("env")
def fixLinkFlag (s):
return s[4:] if s.startswith('-Wl,-T') else s
env.Replace(LINKFLAGS = [fixLinkFlag(i) for i in env['LINKFLAGS']])
| 0 | 0 | 0 | 0 | 0 | 49 | 0 | 0 | 23 |
b9b2a667051deb887cdfb4d7f8a00248b898f9e7 | 393 | py | Python | api/utils/u_json.py | Samge0/UmengEventManage | 4a5a9da8e269a90817a1c382eef0f657c47a10b1 | [
"BSD-3-Clause"
] | null | null | null | api/utils/u_json.py | Samge0/UmengEventManage | 4a5a9da8e269a90817a1c382eef0f657c47a10b1 | [
"BSD-3-Clause"
] | null | null | null | api/utils/u_json.py | Samge0/UmengEventManage | 4a5a9da8e269a90817a1c382eef0f657c47a10b1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2021/10/19 2:38
# @Author : Samge
| 21.833333 | 54 | 0.585242 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2021/10/19 下午2:38
# @Author : Samge
import datetime
import json
class DateEncoder(json.JSONEncoder):
"""
处理日期格式转json
"""
def default(self, obj):
if isinstance(obj, datetime.datetime):
return obj.strftime("%Y-%m-%d %H:%M:%... | 27 | 0 | 0 | 237 | 0 | 0 | 0 | -16 | 67 |
516aae3bdfb65f04981d396ed6ac92d2a84d6848 | 14,676 | py | Python | python/server/lib/sources/lsp_servers/go_gopls.py | hy172574895/EasyCompleteYou | 45304558cbd12769feb5c845c205b22c5d805ac2 | [
"WTFPL"
] | 14 | 2020-02-12T07:03:12.000Z | 2022-01-08T22:15:59.000Z | python/server/lib/sources/lsp_servers/go_gopls.py | hy172574895/EasyCompleteYou | 45304558cbd12769feb5c845c205b22c5d805ac2 | [
"WTFPL"
] | 2 | 2020-02-24T17:01:20.000Z | 2020-10-11T10:37:33.000Z | python/server/lib/sources/lsp_servers/go_gopls.py | hy172574895/EasyCompleteYou | 45304558cbd12769feb5c845c205b22c5d805ac2 | [
"WTFPL"
] | 1 | 2021-04-10T06:42:20.000Z | 2021-04-10T06:42:20.000Z | # Author: Jimmy Huang (1902161621@qq.com)
# License: WTFPL
import logging
global g_logger
g_logger = logging.getLogger('ECY_server')
| 40.994413 | 109 | 0.514718 | # Author: Jimmy Huang (1902161621@qq.com)
# License: WTFPL
import ECY.utils.lsp.language_server_protocol as lsp
import ECY.utils.interface as scope_
import logging
import os
import threading
global g_logger
g_logger = logging.getLogger('ECY_server')
class Operate(scope_.Source_interface):
def __init__(self):
... | 0 | 0 | 0 | 14,401 | 0 | 0 | 0 | 29 | 112 |
57365e09386768e42b99b9eefcc5b28ab5776d71 | 1,831 | py | Python | Q005-v4.py | Linchin/python_leetcode_git | 3d08ab04bbdbd2ce268f33c501fbb149662872c7 | [
"MIT"
] | null | null | null | Q005-v4.py | Linchin/python_leetcode_git | 3d08ab04bbdbd2ce268f33c501fbb149662872c7 | [
"MIT"
] | null | null | null | Q005-v4.py | Linchin/python_leetcode_git | 3d08ab04bbdbd2ce268f33c501fbb149662872c7 | [
"MIT"
] | null | null | null | """
Q005 Longest Palindromic Substring
Medium
08/27/2019
String. Dynamic programming.
Methods:
Dynamic programming;
Manacher's algo;
Palidromic tree;
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.
Example 1:
Input: "babad"
Output: "ba... | 23.474359 | 115 | 0.48935 | """
Q005 Longest Palindromic Substring
Medium
08/27/2019
String. Dynamic programming.
Methods:
Dynamic programming;
Manacher's algo;
Palidromic tree;
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.
Example 1:
Input: "babad"
Output: "ba... | 0 | 0 | 0 | 1,335 | 0 | 0 | 0 | 0 | 23 |
1e0ed37574bf65f8e1a6293ade624921f9ec5486 | 1,970 | py | Python | fileio.py | MiroGasparek/python_intro | 8b4aec8e54f16e33fef506631de0b9ee2e512dea | [
"CC-BY-4.0",
"MIT"
] | null | null | null | fileio.py | MiroGasparek/python_intro | 8b4aec8e54f16e33fef506631de0b9ee2e512dea | [
"CC-BY-4.0",
"MIT"
] | null | null | null | fileio.py | MiroGasparek/python_intro | 8b4aec8e54f16e33fef506631de0b9ee2e512dea | [
"CC-BY-4.0",
"MIT"
] | null | null | null | # 11 February 2018 Miroslav Gasparek
# Python practical on File Input/Output
import os
# Open File
f = open('data/1OLG.pdb','r')
# What is f?
f
f_str = f.read()
f_str[:1000]
f_list = f.readlines()
f_list
# To rewind back to the beginning, we do f.seek(0)
# Go to the beginning of the file
f.seek(0)
# Read the conten... | 26.266667 | 73 | 0.662944 | # 11 February 2018 Miroslav Gasparek
# Python practical on File Input/Output
import os
# Open File
f = open('data/1OLG.pdb','r')
# What is f?
f
f_str = f.read()
f_str[:1000]
f_list = f.readlines()
f_list
# To rewind back to the beginning, we do f.seek(0)
# Go to the beginning of the file
f.seek(0)
# Read the conten... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
655b5a22be58f8b8bc9696bff5d2e265173edb48 | 6,642 | py | Python | src/util/nel/candidate_select.py | delavet/SOworkspace | 74bbcfa62c7e293b2b02f23249ac408aa22b44af | [
"MIT"
] | 6 | 2020-12-31T06:13:56.000Z | 2022-03-27T16:26:12.000Z | src/util/nel/candidate_select.py | delavet/SOworkspace | 74bbcfa62c7e293b2b02f23249ac408aa22b44af | [
"MIT"
] | null | null | null | src/util/nel/candidate_select.py | delavet/SOworkspace | 74bbcfa62c7e293b2b02f23249ac408aa22b44af | [
"MIT"
] | null | null | null | from util.constant import EdgeAttrbutes, EdgeType
from util.utils import get_api_qualified_name_from_entity_id
from .common import api_url_match
from ..concept_map.common import get_latest_concept_map
from elasticsearch import Elasticsearch
import networkx as nx
concept_map = get_latest_concept_map()
Ntype_attribute... | 26.674699 | 143 | 0.595604 | from util.constant import EdgeAttrbutes, EdgeType, NodeAttributes
from util.utils import get_api_qualified_name_from_entity_id
from .common import api_url_match, camel_case_split, longest_common_subsequence
from ..concept_map.common import get_latest_concept_map
from elasticsearch import Elasticsearch
from util.config ... | 923 | 0 | 0 | 0 | 1,822 | 1,908 | 0 | 117 | 250 |
e1d453bf1ab8e9b78cb1c6fe6bcb0cdb09f5a48d | 16,427 | py | Python | rc_pose_controller/src/pose_controller_matlab_net_regulator.py | taranraina/ros_capstone | c9c4734fd22d6dc33e11723b5b2e681f21ae91d5 | [
"MIT"
] | 54 | 2018-03-26T19:01:38.000Z | 2022-03-05T01:19:00.000Z | rc_pose_controller/src/pose_controller_matlab_net_regulator.py | taranraina/ros_capstone | c9c4734fd22d6dc33e11723b5b2e681f21ae91d5 | [
"MIT"
] | 2 | 2019-03-21T10:48:25.000Z | 2019-06-23T09:23:06.000Z | rc_pose_controller/src/pose_controller_matlab_net_regulator.py | taranraina/ros_capstone | c9c4734fd22d6dc33e11723b5b2e681f21ae91d5 | [
"MIT"
] | 19 | 2018-04-13T13:43:29.000Z | 2022-03-06T10:41:34.000Z | #! /usr/bin/env python
# coding: utf-8
# This is pos controller for like-car robot
import numpy as np
import rospy
import tf
import laser_geometry.laser_geometry as lg
from geometry_msgs.msg import Twist, Pose, PoseStamped
from sensor_msgs.msg import PointCloud2, LaserScan
from rc_bringup.cfg import PoseControllerCon... | 30.99434 | 310 | 0.65995 | #! /usr/bin/env python
# coding: utf-8
# This is pos controller for like-car robot
import math
import numpy as np
import rospy
import tf
import tf2_ros
import sensor_msgs.point_cloud2 as pc2
import laser_geometry.laser_geometry as lg
from tf2_sensor_msgs.tf2_sensor_msgs import do_transform_cloud
from geometry_msgs.m... | 0 | 0 | 0 | 0 | 0 | 10,112 | 0 | 41 | 385 |
f7c4b4022d6262e2f2c79133ea77f437c2e82bfe | 20,841 | py | Python | dispatchers.py | jibonaronno/Rhythm | 1c8670d99960b7379fdf6dd006339b96143e7d90 | [
"CC0-1.0"
] | null | null | null | dispatchers.py | jibonaronno/Rhythm | 1c8670d99960b7379fdf6dd006339b96143e7d90 | [
"CC0-1.0"
] | null | null | null | dispatchers.py | jibonaronno/Rhythm | 1c8670d99960b7379fdf6dd006339b96143e7d90 | [
"CC0-1.0"
] | null | null | null |
'''
for char in self.serialport.read():
self.line.append(chr(char))
if chr(char) == '\n':
self.rec_data = "".join(self.line)
self.line.clear()
self.signal_pass_encoder.emit(self.rec_data)
... | 35.747856 | 156 | 0.476513 | import sys
import serial
import pprint
import time
import enum
import queue
from queue import Queue
from os.path import join, dirname, abspath
from qtpy.QtCore import Slot, QTimer, QThread, Signal, QObject, Qt, QMutex
class GcodeStates(enum.Enum):
WAIT_FOR_TIMEOUT = 1
GCODE_SENT = 2
READY_TO_SEND = 3
clas... | 0 | 12,790 | 0 | 5,290 | 0 | 0 | 0 | 20 | 382 |
2ed9534c4794215745c1475ab6d989ff0928b760 | 10,472 | py | Python | user.py | uProxy/1-ufo-management-server | e5d3a9fc704f13d2d0c82fc7cd5ac596c553eca3 | [
"Apache-2.0"
] | 1 | 2018-12-30T11:35:11.000Z | 2018-12-30T11:35:11.000Z | user.py | UWNetworksLab/ufo-management-server | e5d3a9fc704f13d2d0c82fc7cd5ac596c553eca3 | [
"Apache-2.0"
] | null | null | null | user.py | UWNetworksLab/ufo-management-server | e5d3a9fc704f13d2d0c82fc7cd5ac596c553eca3 | [
"Apache-2.0"
] | null | null | null | """The module for handling users."""
import admin
from appengine_config import JINJA_ENVIRONMENT
import base64
from config import PATHS
from datastore import DomainVerification
from datastore import ProxyServer
from datastore import User
from error_handlers import Handle500
import json
import random
import webapp2
... | 31.829787 | 83 | 0.73262 | """The module for handling users."""
import admin
from appengine_config import JINJA_ENVIRONMENT
from ast import literal_eval
import base64
from config import PATHS
from datastore import DomainVerification
from datastore import ProxyServer
from datastore import User
from error_handlers import Handle500
from googleapic... | 0 | 3,914 | 0 | 1,252 | 0 | 0 | 0 | 48 | 272 |
a7b386f43f5857886c3a9cac679f7b5a7c82f10c | 1,642 | py | Python | python_file_examples/testing.py | GustavoMF31/Structured-Editor-For-Python | acab918158609f9649c0c78b72224894e040de78 | [
"MIT"
] | 1 | 2020-07-14T02:14:05.000Z | 2020-07-14T02:14:05.000Z | python_file_examples/testing.py | GustavoMF31/Structured-Editor-For-Python | acab918158609f9649c0c78b72224894e040de78 | [
"MIT"
] | null | null | null | python_file_examples/testing.py | GustavoMF31/Structured-Editor-For-Python | acab918158609f9649c0c78b72224894e040de78 | [
"MIT"
] | null | null | null | from hypothesis import strategies as st
import ast
import actions
# TODO: Make a directory with a bunch of kwnow valid .py files
# And test with them all
# I'm assuming dummy.py isn't messed up
tree = ast.parse(open("dummy.py", "r").read())
list_of_action_names_strategy = st.lists(
st.sampled_from... | 25.65625 | 75 | 0.694275 | from copy import deepcopy
from hypothesis import strategies as st
from hypothesis import given
import ast
import astor
import renderer
import actions
import core_logic
# TODO: Make a directory with a bunch of kwnow valid .py files
# And test with them all
# I'm assuming dummy.py isn't messed up
tree = ast.parse(open... | 0 | 965 | 0 | 0 | 0 | 79 | 0 | -8 | 180 |
ca069be049038f69eefa88862cdea564004d31d9 | 1,095 | py | Python | conrad/utils.py | krishnaprasanthg/conrad | 7d1dba8460c0a262855bb6eff9f5fd2972c4917a | [
"Apache-2.0"
] | null | null | null | conrad/utils.py | krishnaprasanthg/conrad | 7d1dba8460c0a262855bb6eff9f5fd2972c4917a | [
"Apache-2.0"
] | null | null | null | conrad/utils.py | krishnaprasanthg/conrad | 7d1dba8460c0a262855bb6eff9f5fd2972c4917a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
schema_name = "default_event_schema.json"
schema_path = os.path.join(os.path.dirname(__file__), schema_name)
| 24.333333 | 84 | 0.674886 | # -*- coding: utf-8 -*-
import json
import os
import operator as op
from jsonschema import Draft4Validator
from .db import engine
schema_name = "default_event_schema.json"
schema_path = os.path.join(os.path.dirname(__file__), schema_name)
def initialize_database():
from .models import Base
Base.metadata.cr... | 0 | 0 | 0 | 0 | 0 | 782 | 0 | 8 | 159 |
265103091040b8ff1b9bb9686ad9612629692c23 | 989 | py | Python | ditto/twitter/migrations/0049_auto_20160713_1127.py | garrettc/django-ditto | fcf15beb8f9b4d61634efd4a88064df12ee16a6f | [
"MIT"
] | 54 | 2016-08-15T17:32:41.000Z | 2022-02-27T03:32:05.000Z | ditto/twitter/migrations/0049_auto_20160713_1127.py | garrettc/django-ditto | fcf15beb8f9b4d61634efd4a88064df12ee16a6f | [
"MIT"
] | 229 | 2015-07-23T12:50:47.000Z | 2022-03-24T10:33:20.000Z | ditto/twitter/migrations/0049_auto_20160713_1127.py | garrettc/django-ditto | fcf15beb8f9b4d61634efd4a88064df12ee16a6f | [
"MIT"
] | 8 | 2015-09-10T17:10:35.000Z | 2022-03-25T13:05:01.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-13 11:27
from __future__ import unicode_literals
| 26.72973 | 76 | 0.536906 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-13 11:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("twitter", "0048_auto_20160615_1045"),
]
operations = [
migrations.AlterField... | 0 | 0 | 0 | 811 | 0 | 0 | 0 | 19 | 46 |
8fae6de99c5b71d9b28ba14351cbd267d13f0e67 | 3,289 | py | Python | pynegf_test/utils.py | gpenazzi/pynegf | ed3178415848481c43222af70f33c7c0380c602c | [
"MIT"
] | null | null | null | pynegf_test/utils.py | gpenazzi/pynegf | ed3178415848481c43222af70f33c7c0380c602c | [
"MIT"
] | 3 | 2020-03-10T20:12:21.000Z | 2020-04-04T11:12:30.000Z | pynegf_test/utils.py | gpenazzi/pynegf | ed3178415848481c43222af70f33c7c0380c602c | [
"MIT"
] | null | null | null | """
Module with testing utilities.
"""
import numpy
from scipy import sparse
def orthogonal_linear_chain(
nsites=100,
contact_size=20,
coupling=1.0,
onsite=0.0):
"""
Build the hamiltonian of an orthogonal nearest neighbor
linear chain with the correct arrangement for the co... | 30.453704 | 79 | 0.616601 | """
Module with testing utilities.
"""
import numpy
from scipy import sparse
def orthogonal_linear_chain(
nsites=100,
contact_size=20,
coupling=1.0,
onsite=0.0):
"""
Build the hamiltonian of an orthogonal nearest neighbor
linear chain with the correct arrangement for the co... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e969dba3b44e76ff30c0ed6c8b56a7ce7388d7c5 | 2,154 | py | Python | controller/middle_ware.py | oopsteams/pansite | 11896842da66efc72c26eab071f7f802b982f435 | [
"MIT"
] | null | null | null | controller/middle_ware.py | oopsteams/pansite | 11896842da66efc72c26eab071f7f802b982f435 | [
"MIT"
] | 1 | 2021-06-02T01:00:41.000Z | 2021-06-02T01:00:41.000Z | controller/middle_ware.py | oopsteams/pansite | 11896842da66efc72c26eab071f7f802b982f435 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created by susy at 2020/1/27
"""
| 31.676471 | 97 | 0.606778 | # -*- coding: utf-8 -*-
"""
Created by susy at 2020/1/27
"""
from utils import singleton, get_payload_from_token, get_now_ts, decrypt_user_id, log as logger
from utils.constant import USER_TYPE
from tornado.web import RequestHandler
class MiddleWare(object):
def __init__(self):
super().__init__()
def... | 0 | 1,580 | 0 | 196 | 0 | 47 | 0 | 106 | 158 |
800006445d0f4d5c66490ab92f7b44ac99020e5f | 8,248 | py | Python | tests/test_funcs.py | grantps/superhelp | d8e861bf1ad91571ac23b9c833a8cd461bb1952f | [
"MIT"
] | 27 | 2020-05-17T20:48:43.000Z | 2022-01-08T21:32:30.000Z | tests/test_funcs.py | grantps/superhelp | d8e861bf1ad91571ac23b9c833a8cd461bb1952f | [
"MIT"
] | null | null | null | tests/test_funcs.py | grantps/superhelp | d8e861bf1ad91571ac23b9c833a8cd461bb1952f | [
"MIT"
] | null | null | null | from textwrap import dedent
from nose.tools import assert_equal # @UnresolvedImport
from tests import get_actual_result
from superhelp.helpers.func_help import count_args
excess_args = ', '.join(['arg' + str(i) for i in range(100)])
ROOT = 'superhelp.helpers.func_help.'
def test_arg_count():
"""
Testing ... | 31.007519 | 117 | 0.415616 | from textwrap import dedent
from nose.tools import assert_equal # @UnresolvedImport
from tests import check_as_expected, get_repeated_lines, get_actual_result
from superhelp.helpers.func_help import count_args
excess_args = ', '.join(['arg' + str(i) for i in range(100)])
ROOT = 'superhelp.helpers.func_help.'
def... | 0 | 0 | 0 | 0 | 0 | 6,997 | 0 | 39 | 23 |
b1cd2f77bbac68ebc8d7e8af342a1749b64a0b44 | 16,434 | py | Python | test/xslt/test_attribute.py | zepheira/amara | d3ffe07d6e2266b34d72b012a82d572c8edbf1e7 | [
"Apache-2.0"
] | 6 | 2015-01-30T03:50:36.000Z | 2022-03-20T16:09:58.000Z | test/xslt/test_attribute.py | zepheira/amara | d3ffe07d6e2266b34d72b012a82d572c8edbf1e7 | [
"Apache-2.0"
] | 2 | 2015-02-04T17:18:47.000Z | 2019-09-27T23:39:52.000Z | test/xslt/test_attribute.py | zepheira/amara | d3ffe07d6e2266b34d72b012a82d572c8edbf1e7 | [
"Apache-2.0"
] | 6 | 2015-02-04T16:16:18.000Z | 2019-10-30T20:07:48.000Z | ########################################################################
# test/xslt/test_attribute.py
from amara.writers import WriterError, xmlwriter
from amara.xslt import XsltError
PREFIX_TEMPLATE = xmlwriter.xmlwriter.GENERATED_PREFIX
from xslt_support import _run_xml
SOURCE_XML = """<?xml version="1.0"?><dummy... | 39.695652 | 509 | 0.627297 | ########################################################################
# test/xslt/test_attribute.py
from amara.writers import WriterError, xmlwriter
from amara.xslt import XsltError
PREFIX_TEMPLATE = xmlwriter.xmlwriter.GENERATED_PREFIX
from xslt_support import _run_xml
SOURCE_XML = """<?xml version="1.0"?><dummy... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
464582edfebb0e261d68ff21aa333f62e34bc86c | 824 | py | Python | src/dec_pomdp_server/scripts/particle_filter/particle_filter.py | TAMS-Group/decpomdp_signal_source_localization | 3e785c6bb464a1f853b889ce4e3ac343243bc030 | [
"Apache-2.0"
] | null | null | null | src/dec_pomdp_server/scripts/particle_filter/particle_filter.py | TAMS-Group/decpomdp_signal_source_localization | 3e785c6bb464a1f853b889ce4e3ac343243bc030 | [
"Apache-2.0"
] | null | null | null | src/dec_pomdp_server/scripts/particle_filter/particle_filter.py | TAMS-Group/decpomdp_signal_source_localization | 3e785c6bb464a1f853b889ce4e3ac343243bc030 | [
"Apache-2.0"
] | null | null | null |
# Add small Gaussian noise to particles to reinvigorate them
| 30.518519 | 114 | 0.746359 | import numpy as np
def resample(x, weights):
N = weights.size
idx = np.random.choice(N, size=N, p=weights)
x = x[idx,:]
weights = np.repeat(1.0/float(N), N)
return x, weights
# Add small Gaussian noise to particles to reinvigorate them
def particle_reinvigoration(x):
sd = 0.1
return x + np.random.normal(scale=... | 0 | 0 | 0 | 0 | 0 | 673 | 0 | -3 | 90 |
3155b29124ead2d6ce57979aeb82d1fd91766bf7 | 6,903 | py | Python | perfkitbenchmarker/windows_packages/psping.py | markflyhigh/PerfKitBenchmarker | ff34597cae0d0fd171671dafca0dd1d937e4b7d1 | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/windows_packages/psping.py | markflyhigh/PerfKitBenchmarker | ff34597cae0d0fd171671dafca0dd1d937e4b7d1 | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/windows_packages/psping.py | markflyhigh/PerfKitBenchmarker | ff34597cae0d0fd171671dafca0dd1d937e4b7d1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 PerfKitBenchmarker 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 appli... | 30.276316 | 78 | 0.694481 | # Copyright 2018 PerfKitBenchmarker 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 appli... | 0 | 1,852 | 0 | 0 | 0 | 494 | 0 | 59 | 136 |
f414e09ecb6d163f6505cfa2600819ebb97f697d | 2,843 | py | Python | test/CPPPATH/absolute-path.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 1,403 | 2017-11-23T14:24:01.000Z | 2022-03-30T20:59:39.000Z | test/CPPPATH/absolute-path.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 3,708 | 2017-11-27T13:47:12.000Z | 2022-03-29T17:21:17.000Z | test/CPPPATH/absolute-path.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 281 | 2017-12-01T23:48:38.000Z | 2022-03-31T15:25:44.000Z | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | 27.872549 | 73 | 0.700317 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
970eb4d6367655d11afdfad39f4cf826ea48f36b | 1,694 | py | Python | GUI for programming project.py | Bettalion/Programming-Project | 1a99ed37ed90f4fa516b411352a0123b9d0b060b | [
"MIT"
] | null | null | null | GUI for programming project.py | Bettalion/Programming-Project | 1a99ed37ed90f4fa516b411352a0123b9d0b060b | [
"MIT"
] | null | null | null | GUI for programming project.py | Bettalion/Programming-Project | 1a99ed37ed90f4fa516b411352a0123b9d0b060b | [
"MIT"
] | null | null | null | #gui Uses python 2, else uses python 3
if __name__ == '__main__':
main() | 30.25 | 136 | 0.615702 | #gui Uses python 2, else uses python 3
import Tkinter as tk
import time
class Player:
def __init__(self,name,password,score,deck,cards):
self.name=name
self.password=password
self.score=score
self.deck=deck
self.cards=cards
class GUI:
def __init__(self, master):
self.master = maste... | 0 | 0 | 0 | 1,165 | 0 | 308 | 0 | -11 | 139 |
d8cd85e1e5a0185294bf0f6842e101c12a119cd3 | 2,186 | py | Python | code/create_word_index.py | Penn-TopGuNN/TopGuNN | e736e467f1991a33c5ee54407665cbd9fef1e521 | [
"MIT"
] | 5 | 2021-06-11T21:55:29.000Z | 2021-12-08T23:16:40.000Z | code/create_word_index.py | Penn-TopGuNN/TopGuNN | e736e467f1991a33c5ee54407665cbd9fef1e521 | [
"MIT"
] | null | null | null | code/create_word_index.py | Penn-TopGuNN/TopGuNN | e736e467f1991a33c5ee54407665cbd9fef1e521 | [
"MIT"
] | 1 | 2021-08-24T19:36:44.000Z | 2021-08-24T19:36:44.000Z | import time
import argparse
import os
from sqlitedict import SqliteDict
'''usage: (goes in shell script)
python3 -u code/create_word_index.py \
-outDir 'betatest/out/'
'''
'''global argparse'''
parser = argparse.ArgumentParser(description='Processing list of files...')
parser.add_argument('-outDir', required=True, h... | 31.681159 | 142 | 0.668344 | import gzip, json, sys
import numpy as np
import time
import argparse
import os
import util
from sqlitedict import SqliteDict
'''usage: (goes in shell script)
python3 -u code/create_word_index.py \
-outDir 'betatest/out/'
'''
'''global argparse'''
parser = argparse.ArgumentParser(description='Processing list of file... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 66 |
d8edce507cb914fcd72bc82cd55c6560c6198978 | 948 | py | Python | exercises/RMSD.py | LudovicaCataneo/programming_ludovica_cataneo | 536f7921b30e23356ed5a3acb5c00ead0580cca4 | [
"MIT"
] | null | null | null | exercises/RMSD.py | LudovicaCataneo/programming_ludovica_cataneo | 536f7921b30e23356ed5a3acb5c00ead0580cca4 | [
"MIT"
] | null | null | null | exercises/RMSD.py | LudovicaCataneo/programming_ludovica_cataneo | 536f7921b30e23356ed5a3acb5c00ead0580cca4 | [
"MIT"
] | null | null | null | #open the file
filename = open("./model8.pdb", "r")
#for each model in the file, we would like
#to create a list which contains the coordinates of the Carbon alfa atoms
import math
biglist= [] #crea una lista che contenga tutto!
a = -1 #faccio questo per poter partire dal primo elemento*
for line in filename: #per ogni... | 27.882353 | 73 | 0.662447 | #open the file
filename = open("./model8.pdb", "r")
#for each model in the file, we would like
#to create a list which contains the coordinates of the Carbon alfa atoms
import math
biglist= [] #crea una lista che contenga tutto!
a = -1 #faccio questo per poter partire dal primo elemento*
for line in filename: #per ogni... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
859fa3951f6b1529bc8548e4194de6fc976d255f | 9,127 | py | Python | codes3d/download_default_data.py | Genome3d/codes3d-v1 | fe4897cb07bd8b2c10cfc29defe8570d447b69e0 | [
"MIT"
] | null | null | null | codes3d/download_default_data.py | Genome3d/codes3d-v1 | fe4897cb07bd8b2c10cfc29defe8570d447b69e0 | [
"MIT"
] | 4 | 2018-10-25T02:09:37.000Z | 2019-06-27T20:50:27.000Z | codes3d/download_default_data.py | Genome3d/codes3d-v1 | fe4897cb07bd8b2c10cfc29defe8570d447b69e0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse, configparser, os
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Download the default data files for CoDeS3D. These will be downloaded into the default directories specified in the supplied config file (docs/conf.py by default).")
parser.add_argument("... | 48.291005 | 325 | 0.739235 | #!/usr/bin/env python
from ftplib import FTP
import argparse, codes3d, configparser, gzip, os, re, requests, subprocess, sys
def download_snp_data(conf, do_not_build_dbs, do_not_tidy_up):
local_path = os.path.join(conf.get("Defaults","LIB_DIR"),"snps")
if not os.path.isdir(local_path):
os.makedirs(local_path)
... | 0 | 0 | 0 | 0 | 0 | 6,301 | 0 | 47 | 138 |
4ef6e7efa8245fb39e2af7b528dd46c46f5b9f54 | 817 | py | Python | utils/getdataset.py | Troesler95/NN-basic-number-detector | 53122304625b2b9a6641c3f739b44380bf0c4eb4 | [
"MIT"
] | null | null | null | utils/getdataset.py | Troesler95/NN-basic-number-detector | 53122304625b2b9a6641c3f739b44380bf0c4eb4 | [
"MIT"
] | null | null | null | utils/getdataset.py | Troesler95/NN-basic-number-detector | 53122304625b2b9a6641c3f739b44380bf0c4eb4 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
getdataset() | 31.423077 | 87 | 0.559364 | import os
import numpy as np
def getdataset():
# Get the path do the data file
cur_path = os.getcwd()
data_filepath = os.path.join(cur_path, os.path.dirname("dataset/"), "semeion.data")
print("data_filepath: " + data_filepath)
x = np.empty((1593, 16*16), dtype=np.float)
y = np.empty((1593, 10)... | 0 | 0 | 0 | 0 | 0 | 721 | 0 | -15 | 67 |
0f4e093850a7ddb2b109c44fbfe350f841b9bdfe | 2,898 | py | Python | src/simmate/toolkit/transformations/from_ase/lattice_strain.py | jacksund/simmate | 0b29704540574e11b711f7b44e2cb7740141ebb4 | [
"BSD-3-Clause"
] | 9 | 2021-12-21T02:58:21.000Z | 2022-01-25T14:00:06.000Z | src/simmate/toolkit/transformations/from_ase/lattice_strain.py | jacksund/simmate | 0b29704540574e11b711f7b44e2cb7740141ebb4 | [
"BSD-3-Clause"
] | 51 | 2022-01-01T15:59:58.000Z | 2022-03-26T21:25:42.000Z | src/simmate/toolkit/transformations/from_ase/lattice_strain.py | jacksund/simmate | 0b29704540574e11b711f7b44e2cb7740141ebb4 | [
"BSD-3-Clause"
] | 7 | 2022-01-01T03:44:32.000Z | 2022-03-29T19:59:27.000Z | # -*- coding: utf-8 -*-
| 35.341463 | 105 | 0.641477 | # -*- coding: utf-8 -*-
from simmate.toolkit.transformations.base import Transformation
class LatticeStrain(Transformation):
# known as StrainMutation in ase.ga
# https://gitlab.com/ase/ase/-/blob/master/ase/ga/standardmutations.py
io_scale = "one_to_one"
ninput = 1
use_multiprocessing = False
... | 0 | 0 | 0 | 2,785 | 0 | 0 | 0 | 42 | 46 |
ee775790162485c2f3f9f53f11a8930a5d18e531 | 1,622 | py | Python | day5/part2.py | THEANTsMAN/AoC2021 | 4be49efb313dc6636f4fb2471a3b16206fc9a311 | [
"MIT"
] | null | null | null | day5/part2.py | THEANTsMAN/AoC2021 | 4be49efb313dc6636f4fb2471a3b16206fc9a311 | [
"MIT"
] | null | null | null | day5/part2.py | THEANTsMAN/AoC2021 | 4be49efb313dc6636f4fb2471a3b16206fc9a311 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main() | 19.780488 | 61 | 0.545006 | import sys
import fileinput
import numpy as np
def getInput(filePath):
content = []
input = fileinput.input(files=(filePath), mode='r')
for line in input:
content.append(line.rstrip())
return content
def getVectors(A, B):
vector = []
Xstart = A[0]
Xstop = B[0]
Xstep = 1
if Xstart == Xstop:
... | 0 | 0 | 0 | 0 | 0 | 1,465 | 0 | -19 | 137 |
027a12e4ef1c3b00f5a9877a563332a7a3bdca5f | 3,588 | py | Python | worldometer_nat.py | avengercelona/Covid19_Stats | 7f43c0a375201dc4fbe9ddd1ece0b56a2771cefd | [
"MIT"
] | null | null | null | worldometer_nat.py | avengercelona/Covid19_Stats | 7f43c0a375201dc4fbe9ddd1ece0b56a2771cefd | [
"MIT"
] | null | null | null | worldometer_nat.py | avengercelona/Covid19_Stats | 7f43c0a375201dc4fbe9ddd1ece0b56a2771cefd | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import requests
link='https://www.worldometers.info/coronavirus/'
source = requests.get(link).text
soup = BeautifulSoup(source, 'lxml') | 35.176471 | 98 | 0.598662 | from bs4 import BeautifulSoup
import requests
import json
link='https://www.worldometers.info/coronavirus/'
source = requests.get(link).text
soup = BeautifulSoup(source, 'lxml')
def extract_nat():
#locating required data
tb=soup.find('table',id='main_table_countries_today')
rows=tb.find_all('tr',class_... | 0 | 0 | 0 | 0 | 0 | 3,315 | 0 | -10 | 114 |
c85072a49dc2db870e91def66a879adfa3f4cc0e | 1,428 | py | Python | insights/parsers/satellite_content_hosts_count.py | haithcockce/insights-core | b2e197c6bfc25bcbe2926f07c35a80f2cf8232f5 | [
"Apache-2.0"
] | 121 | 2017-05-30T20:23:25.000Z | 2022-03-23T12:52:15.000Z | insights/parsers/satellite_content_hosts_count.py | haithcockce/insights-core | b2e197c6bfc25bcbe2926f07c35a80f2cf8232f5 | [
"Apache-2.0"
] | 1,977 | 2017-05-26T14:36:03.000Z | 2022-03-31T10:38:53.000Z | insights/parsers/satellite_content_hosts_count.py | haithcockce/insights-core | b2e197c6bfc25bcbe2926f07c35a80f2cf8232f5 | [
"Apache-2.0"
] | 244 | 2017-05-30T20:22:57.000Z | 2022-03-26T10:09:39.000Z | """
SatelliteContentHostsCount - command ``psql -d foreman -c 'select count(*) from hosts'``
========================================================================================
The SatelliteContentHostsCount parser reads the output of
``psql -d foreman -c 'select count(*) from hosts'``.
Sample output of ``psql -... | 30.382979 | 88 | 0.618347 | """
SatelliteContentHostsCount - command ``psql -d foreman -c 'select count(*) from hosts'``
========================================================================================
The SatelliteContentHostsCount parser reads the output of
``psql -d foreman -c 'select count(*) from hosts'``.
Sample output of ``psql -... | 0 | 699 | 0 | 0 | 0 | 0 | 0 | 69 | 90 |
f189cebe2f26722af23468e59d891613ab08abdc | 365 | py | Python | tests/data/expected/main/multiple_files_self_ref_single/output.py | adaamz/datamodel-code-generator | 3b34573f35f8d420e4668a85047c757fd1da7754 | [
"MIT"
] | 891 | 2019-07-23T04:23:32.000Z | 2022-03-31T13:36:33.000Z | tests/data/expected/main/multiple_files_self_ref_single/output.py | adaamz/datamodel-code-generator | 3b34573f35f8d420e4668a85047c757fd1da7754 | [
"MIT"
] | 663 | 2019-07-23T09:50:26.000Z | 2022-03-29T01:56:55.000Z | tests/data/expected/main/multiple_files_self_ref_single/output.py | adaamz/datamodel-code-generator | 3b34573f35f8d420e4668a85047c757fd1da7754 | [
"MIT"
] | 108 | 2019-07-23T08:50:37.000Z | 2022-03-09T10:50:22.000Z | # generated by datamodel-codegen:
# filename: test.json
# timestamp: 2019-07-26T00:00:00+00:00
from __future__ import annotations
| 17.380952 | 52 | 0.715068 | # generated by datamodel-codegen:
# filename: test.json
# timestamp: 2019-07-26T00:00:00+00:00
from __future__ import annotations
from pydantic import BaseModel, Field
class Second(BaseModel):
__root__: str
class First(BaseModel):
__root__: Second
class Model(BaseModel):
test_id: str = Field(..... | 0 | 0 | 0 | 118 | 0 | 0 | 0 | 16 | 92 |
9e7492d686e3f7a7f59490481441b2e9f8e6712e | 340 | py | Python | setup.py | minamorl/redisorm | e5eb0e9e0c65d6dd6a35d0f086b7d147cbfbd4d1 | [
"MIT"
] | null | null | null | setup.py | minamorl/redisorm | e5eb0e9e0c65d6dd6a35d0f086b7d147cbfbd4d1 | [
"MIT"
] | null | null | null | setup.py | minamorl/redisorm | e5eb0e9e0c65d6dd6a35d0f086b7d147cbfbd4d1 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="redis-orm",
description="Redis object relation mapper",
author="minamorl",
author_email="minamorl@minamorl.com",
version="0.4.1",
packages=find_packages(),
tests_require=['tox'],
install_requires=[
"redis",
"python... | 21.25 | 47 | 0.641176 | from setuptools import setup, find_packages
setup(
name="redis-orm",
description="Redis object relation mapper",
author="minamorl",
author_email="minamorl@minamorl.com",
version="0.4.1",
packages=find_packages(),
tests_require=['tox'],
install_requires=[
"redis",
"python... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
61ca3e401f4f509ca5eca02a19da61a8c4f835f8 | 3,306 | py | Python | corehq/messaging/smsbackends/unicel/models.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/messaging/smsbackends/unicel/models.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/messaging/smsbackends/unicel/models.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | import codecs
from corehq.apps.sms.api import incoming
OUTBOUND_URLBASE = "http://www.unicel.in/SendSMS/sendmsg.php"
# constant additional parameters when sending a unicode message
UNICODE_PARAMS = [("udhi", 0),
("dcs", 8)]
def create_from_request(request, backend_id=None):
"""
From an ... | 28.5 | 105 | 0.65487 | import codecs
from corehq.apps.sms.util import clean_phone_number
from corehq.apps.sms.api import incoming
from corehq.apps.sms.models import SQLSMSBackend
from six.moves.urllib.request import urlopen
from six.moves.urllib.parse import urlencode
from corehq.messaging.smsbackends.unicel.forms import UnicelBackendForm
f... | 0 | 268 | 0 | 1,658 | 0 | 0 | 0 | 164 | 202 |
8e857db16980103b711c1afdac0dfe81ba3aa323 | 5,969 | py | Python | app/views.py | rahowa/workzone | b6fd3241fdbc9463e0e7eb863f82f9524be50830 | [
"MIT"
] | 1 | 2020-04-25T07:49:11.000Z | 2020-04-25T07:49:11.000Z | app/views.py | rahowa/workzone | b6fd3241fdbc9463e0e7eb863f82f9524be50830 | [
"MIT"
] | null | null | null | app/views.py | rahowa/workzone | b6fd3241fdbc9463e0e7eb863f82f9524be50830 | [
"MIT"
] | 1 | 2020-04-23T10:24:56.000Z | 2020-04-23T10:24:56.000Z | import sys
from flask import Blueprint
sys.path.append("./robot_work_zone_estimation")
bp_main = Blueprint('blueprint_main', __name__)
# TODO: cache wrappers
# TODO : cachle loading
| 37.074534 | 102 | 0.659239 | import sys
import json
import numpy as np
from typing import Any, Union
from flask import Response, Blueprint, request
sys.path.append("./robot_work_zone_estimation")
from app.extensions import mongo, cache
from app.route_utils import load_classes
from app.fill_databse import FillDatabase
from app.objects_utils impor... | 0 | 4,896 | 0 | 0 | 0 | 0 | 0 | 435 | 445 |
c598cb2387eb7fa7cd75f5c944e9fcdf32887d60 | 1,544 | py | Python | src/ims/model/json/_priority.py | burningmantech/ranger-ims-server | 66c8158b93c80ca342856666acb2689287db8043 | [
"Apache-2.0"
] | 26 | 2015-11-04T19:14:28.000Z | 2022-01-28T14:31:06.000Z | src/ims/model/json/_priority.py | burningmantech/ranger-ims-server | 66c8158b93c80ca342856666acb2689287db8043 | [
"Apache-2.0"
] | 508 | 2015-04-28T00:24:51.000Z | 2022-03-30T17:29:47.000Z | src/ims/model/json/_priority.py | burningmantech/ranger-ims-server | 66c8158b93c80ca342856666acb2689287db8043 | [
"Apache-2.0"
] | 6 | 2015-04-15T13:58:40.000Z | 2019-12-09T00:47:40.000Z | ##
# See the file COPYRIGHT for copyright information.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 24.903226 | 76 | 0.750648 | ##
# See the file COPYRIGHT for copyright information.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 0 | 0 | 0 | 108 | 0 | 394 | 0 | 2 | 114 |
7b1b92085b571c28eed2edec378eba85fd49ccfc | 235 | py | Python | settings.py | GuidoDipietro/geckolang | a75c3b7056e48b0ed118a70f2b3da966ecb1eb89 | [
"BSD-3-Clause"
] | 4 | 2021-08-29T17:46:56.000Z | 2021-11-11T01:55:18.000Z | settings.py | GuidoDipietro/geckolang | a75c3b7056e48b0ed118a70f2b3da966ecb1eb89 | [
"BSD-3-Clause"
] | 4 | 2021-08-31T20:02:43.000Z | 2021-09-30T14:46:54.000Z | settings.py | GuidoDipietro/geckolang | a75c3b7056e48b0ed118a70f2b3da966ecb1eb89 | [
"BSD-3-Clause"
] | 1 | 2022-03-23T21:50:45.000Z | 2022-03-23T21:50:45.000Z | # Tab
TAB_SIZE = 1
tab = ' ' * TAB_SIZE
# Colors
USING_COLOR = 'magenta'
FINAL_COLOR = 'cyan'
ANS_COLOR = 'cyan'
INVALID_COLOR = 'red'
VAR_COLOR = 'red'
FUNC_ERR_COLOR = 'green' | 21.363636 | 32 | 0.519149 | # Tab
TAB_SIZE = 1
tab = ' ' * TAB_SIZE
# Colors
USING_COLOR = 'magenta'
FINAL_COLOR = 'cyan'
ANS_COLOR = 'cyan'
INVALID_COLOR = 'red'
VAR_COLOR = 'red'
FUNC_ERR_COLOR = 'green' | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
864b80d473477207db789a18c3f444e2c60d893d | 2,189 | py | Python | utils/quad2rbox.py | JoelPendleton/QDot-Detector | e53b80c02fe95ceacd3dde9981dcd0481b907bdc | [
"Apache-2.0"
] | null | null | null | utils/quad2rbox.py | JoelPendleton/QDot-Detector | e53b80c02fe95ceacd3dde9981dcd0481b907bdc | [
"Apache-2.0"
] | null | null | null | utils/quad2rbox.py | JoelPendleton/QDot-Detector | e53b80c02fe95ceacd3dde9981dcd0481b907bdc | [
"Apache-2.0"
] | null | null | null | import numpy as np
import tensorflow as tf
import sys
sys.path.append('../')
from libs.utils.coordinate_convert import backward_convert
if __name__ == "__main__":
quad = np.array([[278, 418, 308, 331, 761, 581, 691, 668],
[758, 418, 348, 331, 241, 581, 591, 668],
[624... | 33.676923 | 115 | 0.567839 | import numpy as np
import math
import tensorflow as tf
import sys
sys.path.append('../')
from libs.utils.coordinate_convert import backward_convert
def dist(p1, p2):
return np.linalg.norm(p1 - p2, axis=1)
def quad2rbox(boxes):
# input: ordered points (bs, 8)
nB = len(boxes)
points = boxes.reshape(-... | 0 | 0 | 0 | 0 | 0 | 1,507 | 0 | -10 | 114 |
0171a039f354b802e3b60ee7ff72a155d842bd74 | 217 | py | Python | setup.py | reynard225/reyn | 73372548e01f4d31e8a01388526e6446bc3b6047 | [
"PostgreSQL"
] | null | null | null | setup.py | reynard225/reyn | 73372548e01f4d31e8a01388526e6446bc3b6047 | [
"PostgreSQL"
] | null | null | null | setup.py | reynard225/reyn | 73372548e01f4d31e8a01388526e6446bc3b6047 | [
"PostgreSQL"
] | null | null | null | from setuptools import setup
setup(
name='telegram_fdw',
version='0.1.0',
author='Dickson S. Guedes',
license='PostgreSQL',
packages=['telegram_fdw']
)
| 19.727273 | 54 | 0.695853 | import subprocess
from setuptools import setup, find_packages, Extension
setup(
name='telegram_fdw',
version='0.1.0',
author='Dickson S. Guedes',
license='PostgreSQL',
packages=['telegram_fdw']
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 22 |
db499cd1a83aea2c0ab77dab8c8925d31411de56 | 9,000 | py | Python | finrl/neo_finrl/env_portfolio_allocation/portfolio_allocation.py | haitt00/FinRL-Library | 4361a20abaeb73012bb0a9588549bbabb42037a3 | [
"MIT"
] | null | null | null | finrl/neo_finrl/env_portfolio_allocation/portfolio_allocation.py | haitt00/FinRL-Library | 4361a20abaeb73012bb0a9588549bbabb42037a3 | [
"MIT"
] | null | null | null | finrl/neo_finrl/env_portfolio_allocation/portfolio_allocation.py | haitt00/FinRL-Library | 4361a20abaeb73012bb0a9588549bbabb42037a3 | [
"MIT"
] | null | null | null | import matplotlib
matplotlib.use("Agg")
| 36.885246 | 129 | 0.584333 | import gym
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from gym import spaces
from gym.utils import seeding
from stable_baselines3.common.vec_env import DummyVecEnv
import decimal
matplotlib.use("Agg")
class StockPortfolioEnv(gym.Env):
metadata = {"render.modes": ... | 0 | 0 | 0 | 8,727 | 0 | 0 | 0 | 31 | 201 |
0a171d93586f08d7f308f52ab6bbc80ed7ece40e | 21 | py | Python | app.py | Morgan140/ml-project-sudo-scrapper | b25664f135ae01403af04b4f9feff3082f5cd0fe | [
"Apache-2.0"
] | 1 | 2020-10-03T11:22:44.000Z | 2020-10-03T11:22:44.000Z | app.py | Morgan140/ml-project-sudo-scrapper | b25664f135ae01403af04b4f9feff3082f5cd0fe | [
"Apache-2.0"
] | 1 | 2020-10-03T10:56:42.000Z | 2020-10-03T10:56:42.000Z | app.py | Morgan140/ml-project-sudo-scrapper | b25664f135ae01403af04b4f9feff3082f5cd0fe | [
"Apache-2.0"
] | null | null | null | intpt import jaa.lls
| 10.5 | 20 | 0.809524 | intpt import jaa.lls
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bb6de9c5584cd165c66909a7f3254ffbcd30a914 | 5,013 | py | Python | src/gen/LPC_gencore.py | ufo2011/NXP-MCUBootUtility | 5d1840b1beee997e5453484309f5466ce166bfbe | [
"Apache-2.0"
] | 174 | 2018-12-30T16:20:36.000Z | 2022-03-24T03:02:02.000Z | src/gen/LPC_gencore.py | ufo2011/NXP-MCUBootUtility | 5d1840b1beee997e5453484309f5466ce166bfbe | [
"Apache-2.0"
] | 138 | 2019-01-02T16:18:44.000Z | 2022-03-30T15:57:24.000Z | src/gen/LPC_gencore.py | ufo2011/NXP-MCUBootUtility | 5d1840b1beee997e5453484309f5466ce166bfbe | [
"Apache-2.0"
] | 86 | 2018-12-27T13:16:58.000Z | 2022-02-03T11:42:35.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
sys.path.append(os.path.abspath(".."))
| 41.429752 | 177 | 0.664273 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import shutil
import json
import subprocess
import bincopy
import gendef
import LPC_gendef
sys.path.append(os.path.abspath(".."))
from ui import LPC_uicore
from ui import LPC_uidef
from ui import uidef
from ui import uivar
from ui import uilang
from ru... | 0 | 0 | 0 | 4,555 | 0 | 0 | 0 | -24 | 375 |
1119529310128e46b9c85b66b7c8b8e50f596bcd | 303 | py | Python | ex077.py | raphael-abrantes/exercises-python | 71f1e7cba2f56173c256d43e4fe33a43722b4484 | [
"MIT"
] | null | null | null | ex077.py | raphael-abrantes/exercises-python | 71f1e7cba2f56173c256d43e4fe33a43722b4484 | [
"MIT"
] | null | null | null | ex077.py | raphael-abrantes/exercises-python | 71f1e7cba2f56173c256d43e4fe33a43722b4484 | [
"MIT"
] | null | null | null | tPalavras = (
'aprender',
'programar',
'linguagem',
'python',
'curso',
'gratis',
'try'
)
for i in tPalavras:
print(f'\nNa palavra {i.upper()} temos: ', end = '')
for letra in i:
if letra.lower() in 'aeiou':
print(letra, end = ' ')
| 18.9375 | 57 | 0.471947 | tPalavras = (
'aprender',
'programar',
'linguagem',
'python',
'curso',
'gratis',
'try'
)
for i in tPalavras:
print(f'\nNa palavra {i.upper()} temos: ', end = '')
for letra in i:
if letra.lower() in 'aeiou':
print(letra, end = ' ')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
be1f1c1d94b16bfe17346eabeee553f8c3e1965a | 5,364 | py | Python | ogb_examples/graphproppred/mol/data/splitters.py | zhch8888168/PGL | 2e518bc0bb61f73b711f6bad102fad22b55020dc | [
"Apache-2.0"
] | 2 | 2020-11-29T08:59:16.000Z | 2020-12-01T10:47:00.000Z | ogb_examples/graphproppred/mol/data/splitters.py | cheeryoung79/PGL | fc517bbb87c570d0b854507769078c479d613914 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-04-29T13:38:01.000Z | 2020-04-29T13:38:01.000Z | ogb_examples/graphproppred/mol/data/splitters.py | cheeryoung79/PGL | fc517bbb87c570d0b854507769078c479d613914 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-09-01T12:00:31.000Z | 2021-09-01T12:00:31.000Z | # Copyright (c) 2020 PaddlePaddle 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 appli... | 34.831169 | 78 | 0.694817 | # Copyright (c) 2020 PaddlePaddle 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 appli... | 0 | 0 | 0 | 0 | 0 | 3,410 | 0 | 111 | 294 |
6b9cdbc46218c039c62bb8831e107a8820147ee0 | 1,497 | py | Python | beer/nnet/residual.py | bolajiy/beer | 6fe968c7ca4864437890aa6bd705755c2580696e | [
"MIT"
] | 46 | 2018-02-27T18:15:08.000Z | 2022-02-16T22:10:55.000Z | beer/nnet/residual.py | bolajiy/beer | 6fe968c7ca4864437890aa6bd705755c2580696e | [
"MIT"
] | 16 | 2018-01-26T14:18:51.000Z | 2021-02-05T09:34:00.000Z | beer/nnet/residual.py | bolajiy/beer | 6fe968c7ca4864437890aa6bd705755c2580696e | [
"MIT"
] | 26 | 2018-03-12T14:03:26.000Z | 2021-05-24T21:15:01.000Z |
__all__ = ['ResidualFeedForwardNet']
| 31.1875 | 74 | 0.519038 | import torch
__all__ = ['ResidualFeedForwardNet']
class ResidualFeedFowardBlock(torch.nn.Module):
'''Block of two feed-forward layer with a reisdual connection:
f(W1^T x + b1) f(W2^T h1 + b2 ) h2 + x
x ------------------> h1 --------------------> h2 ----------> y
... | 0 | 152 | 0 | 1,244 | 0 | 0 | 0 | -9 | 68 |
a6f6bd63c7a98e3087c7019cc57a1c749282e1b4 | 4,305 | py | Python | test_series_count.py | soothingjennyg/pandasTestingProject | c1bf9ec30723316c992f57dd9e2c5e2215dbe595 | [
"MIT"
] | null | null | null | test_series_count.py | soothingjennyg/pandasTestingProject | c1bf9ec30723316c992f57dd9e2c5e2215dbe595 | [
"MIT"
] | null | null | null | test_series_count.py | soothingjennyg/pandasTestingProject | c1bf9ec30723316c992f57dd9e2c5e2215dbe595 | [
"MIT"
] | 1 | 2021-12-08T20:59:09.000Z | 2021-12-08T20:59:09.000Z | import unittest
'''
The series.count function that we are testing does:
Return number of non-NA/null observations in the Series.
Parameters
----------
level : int or level name, default None
If the axis is a MultiIndex (hierarchical), count along a
particular level, collapsing in... | 33.897638 | 115 | 0.659698 | from numpy import NaN
import pandas as pd
import unittest
import numpy as np
'''
The series.count function that we are testing does:
Return number of non-NA/null observations in the Series.
Parameters
----------
level : int or level name, default None
If the axis is a MultiIndex (hierarc... | 0 | 0 | 0 | 2,483 | 0 | 0 | 0 | -5 | 89 |
a3b69191b215d35c511f31daed29f9ac1d3409b3 | 2,744 | py | Python | main.py | EiEiKyaw/Right | 710665ce0ee132f56249530cf1389b4b7fabb9be | [
"MIT"
] | null | null | null | main.py | EiEiKyaw/Right | 710665ce0ee132f56249530cf1389b4b7fabb9be | [
"MIT"
] | null | null | null | main.py | EiEiKyaw/Right | 710665ce0ee132f56249530cf1389b4b7fabb9be | [
"MIT"
] | null | null | null |
from flask import Flask
app = Flask(__name__)
if __name__ == "__main__":
app.run(debug=True)
| 27.168317 | 75 | 0.680394 |
from flask import Flask , render_template, request, jsonify
import Uni_To_Zg
import Zg_To_Uni
import Win_To_Uni
import Uni_To_Win
app = Flask(__name__)
@app.route("/")
def home():
return render_template("index.html")
@app.route("/about")
def about():
return render_template("about.html")
@app.route("/conv... | 0 | 2,213 | 0 | 0 | 0 | 0 | 0 | 18 | 411 |
4c3d02dd60bf681e4f4859f6c7031155c2c82ca0 | 2,671 | py | Python | integration_tests/async_contract.py | terra-money/terra.py | d66de6bb4d9d78f08ad8ffe05ae72d847fc5099d | [
"MIT"
] | 66 | 2021-10-21T23:29:38.000Z | 2022-03-30T15:58:13.000Z | integration_tests/async_contract.py | terra-money/terra.py | d66de6bb4d9d78f08ad8ffe05ae72d847fc5099d | [
"MIT"
] | 50 | 2021-10-19T06:11:56.000Z | 2022-03-31T17:06:57.000Z | integration_tests/async_contract.py | terra-money/terra.py | d66de6bb4d9d78f08ad8ffe05ae72d847fc5099d | [
"MIT"
] | 39 | 2021-11-07T17:28:31.000Z | 2022-03-31T15:03:57.000Z | import asyncio
import uvloop
uvloop.install()
asyncio.run(main())
| 32.180723 | 165 | 0.639835 | import asyncio
from pathlib import Path
import uvloop
from terra_sdk.client.lcd import AsyncLCDClient
from terra_sdk.client.lcd.api.tx import CreateTxOptions
from terra_sdk.core.wasm import MsgExecuteContract, MsgInstantiateContract, MsgStoreCode
from terra_sdk.key.mnemonic import MnemonicKey
from terra_sdk.util.cont... | 0 | 0 | 2,224 | 0 | 0 | 0 | 0 | 221 | 156 |
d64b483e1855aad14456f95fbca8b12406695c81 | 1,827 | py | Python | grascii/dictionary/install.py | chanicpanic/grascii | 654d24529dd8373d9df35f07b06323bb17ed7ffb | [
"MIT"
] | 3 | 2020-10-02T11:45:47.000Z | 2021-06-27T01:16:08.000Z | grascii/dictionary/install.py | chanicpanic/grascii | 654d24529dd8373d9df35f07b06323bb17ed7ffb | [
"MIT"
] | 2 | 2021-07-03T23:09:00.000Z | 2021-07-06T17:46:02.000Z | grascii/dictionary/install.py | grascii/grascii | 654d24529dd8373d9df35f07b06323bb17ed7ffb | [
"MIT"
] | null | null | null |
import argparse
from pathlib import Path
import sys
from grascii.appdirs import user_data_dir
from grascii.config import APP_NAME
description = "Install a Grascii Dictionary"
DICTIONARY_PATH = Path(user_data_dir(APP_NAME), "dictionaries")
def main() -> None:
"""Run the install command using arguments from sy... | 30.966102 | 86 | 0.673235 |
import argparse
from pathlib import Path, PurePath
from shutil import copy
import sys
from grascii.appdirs import user_data_dir
from grascii.config import APP_NAME
description = "Install a Grascii Dictionary"
DICTIONARY_PATH = Path(user_data_dir(APP_NAME), "dictionaries")
def build_argparser(argparser: argparse.Ar... | 0 | 0 | 0 | 0 | 0 | 1,201 | 0 | 12 | 91 |
94940ce1fefb22038b5218d31446bce4e688b7ec | 744 | py | Python | buffer/shard-cpp-test/master-node/test-medium/run_gtests_test.py | zaqwes8811/coordinator-tasks | 7f63fdf613eff5d441a3c2c7b52d2a3d02d9736a | [
"MIT"
] | null | null | null | buffer/shard-cpp-test/master-node/test-medium/run_gtests_test.py | zaqwes8811/coordinator-tasks | 7f63fdf613eff5d441a3c2c7b52d2a3d02d9736a | [
"MIT"
] | 15 | 2015-03-07T12:46:41.000Z | 2015-04-11T09:08:36.000Z | buffer/shard-cpp-test/master-node/test-medium/run_gtests_test.py | zaqwes8811/micro-apps | 7f63fdf613eff5d441a3c2c7b52d2a3d02d9736a | [
"MIT"
] | null | null | null | # coding: utf-8
import sys
if sys.version_info[0:2] != (2, 6):
raise Exception("Must use python 2.6")
import os
# Inner Reuse
# App
RUNNER_TASK_FILE = os.sep.join(['_code', 'task_files', 'main_task.py'])
BIN_FILE_NAME = os.sep.join(['..', 'statistic', 'exec', 'gtest-extend.bin'])
count_cores = 4
test_run_gt... | 20.666667 | 76 | 0.680108 | # coding: utf-8
import sys
if sys.version_info[0:2] != (2, 6):
raise Exception("Must use python 2.6")
import os
# Inner Reuse
from inner_reuse.configurer import Configurer
from inner_reuse import tic, toc
# App
from _code.gtest_runner import run_gtests
RUNNER_TASK_FILE = os.sep.join(['_code', 'task_files', 'm... | 0 | 0 | 0 | 0 | 0 | 263 | 0 | 55 | 89 |
17c81ca73e466a3e0a357719d0ea95a854190e32 | 22,386 | py | Python | src/running.py | xygxue/cluster | c54304113ff0a2077569bd4044bfc06f37fcf9af | [
"MIT"
] | null | null | null | src/running.py | xygxue/cluster | c54304113ff0a2077569bd4044bfc06f37fcf9af | [
"MIT"
] | null | null | null | src/running.py | xygxue/cluster | c54304113ff0a2077569bd4044bfc06f37fcf9af | [
"MIT"
] | null | null | null | import logging
import sys
import os
import traceback
import json
from datetime import datetime
import string
import random
import time
from functools import partial
import torch
import numpy as np
from utils import utils
from datasets.dataset import ImputationDataset, TransductionDataset, ClassiregressionDataset, coll... | 45.042254 | 162 | 0.651345 | import logging
import sys
import os
import traceback
import json
from datetime import datetime
import string
import random
from collections import OrderedDict
import time
import pickle
from functools import partial
import ipdb
import torch
from torch.utils.data import DataLoader
import numpy as np
import sklearn
from... | 0 | 0 | 0 | 11,832 | 0 | 2,891 | 0 | 31 | 248 |
06e239535faef824bffe1c70cf0e26d7d8b0b0ea | 48,649 | py | Python | Face Reconstruction/3D Face Reconstruction using Graph Convolution Network/base_model.py | swapnilgarg7/Face-X | fab21bf667fa7387b8e73e5a1d72fcba4fba2818 | [
"MIT"
] | 314 | 2020-05-18T07:33:20.000Z | 2022-03-28T07:29:20.000Z | Face Reconstruction/3D Face Reconstruction using Graph Convolution Network/base_model.py | swapnilgarg7/Face-X | fab21bf667fa7387b8e73e5a1d72fcba4fba2818 | [
"MIT"
] | 704 | 2020-09-30T10:44:13.000Z | 2022-03-30T07:18:28.000Z | Face Reconstruction/3D Face Reconstruction using Graph Convolution Network/base_model.py | swapnilgarg7/Face-X | fab21bf667fa7387b8e73e5a1d72fcba4fba2818 | [
"MIT"
] | 342 | 2020-10-02T14:04:49.000Z | 2022-03-31T10:14:20.000Z | import logging
logger = logging.getLogger('x')
| 45.38153 | 180 | 0.641966 | import logging
import math
import os
import shutil
import time
import cv2
import imageio
import numpy as np
import scipy.sparse
import tensorflow as tf
import utils
from lib import graph, mesh_renderer
from lib.mesh_io import write_obj
logger = logging.getLogger('x')
class BaseModel():
"""
Mesh Convolutional... | 0 | 0 | 0 | 48,354 | 0 | 0 | 0 | -43 | 289 |
b8eeae7341e09cf8d911ebd5985806f15f14f470 | 15,085 | py | Python | fs/copy.py | dhirschfeld/pyfilesystem2 | b2c0d96f55d4dfe777b4f9476676b77d01f36bf7 | [
"MIT"
] | null | null | null | fs/copy.py | dhirschfeld/pyfilesystem2 | b2c0d96f55d4dfe777b4f9476676b77d01f36bf7 | [
"MIT"
] | null | null | null | fs/copy.py | dhirschfeld/pyfilesystem2 | b2c0d96f55d4dfe777b4f9476676b77d01f36bf7 | [
"MIT"
] | null | null | null | """Functions for copying resources *between* filesystem.
"""
from __future__ import print_function, unicode_literals
from .errors import FSError
from .opener import manage_fs
from .path import abspath, combine, frombase, normpath
from .tools import is_thread_safe
from .walk import Walker
if False: # typing.TYPE_CHE... | 38.979328 | 81 | 0.600398 | """Functions for copying resources *between* filesystem.
"""
from __future__ import print_function, unicode_literals
import typing
from .errors import FSError
from .opener import manage_fs
from .path import abspath, combine, frombase, normpath
from .tools import is_thread_safe
from .walk import Walker
if False: # ... | 0 | 0 | 0 | 0 | 0 | 148 | 0 | 9 | 131 |
d5939e241bf3648ce17af265074b984d2e70dfa5 | 995 | py | Python | comparison.py | gabriel-valle/minimizer | eb3e42ca5fa4667c712ad2228a6c8af3bdb73185 | [
"MIT"
] | null | null | null | comparison.py | gabriel-valle/minimizer | eb3e42ca5fa4667c712ad2228a6c8af3bdb73185 | [
"MIT"
] | null | null | null | comparison.py | gabriel-valle/minimizer | eb3e42ca5fa4667c712ad2228a6c8af3bdb73185 | [
"MIT"
] | null | null | null | import numpy as np
import minimize as mini
# f(x, y) = 100(y-x) + (1-x)
mims = []
methods = ["newton", "BFGS", "gradient"]
colors = ["darkblue", "yellow", "purple"]
for i in range(len(methods)):
mims.append(mini.Minimizer(f, 2, np.array([0, 0])))
mims[i].f_grad = grad_f
mims[i].f_hess = hess_f
mims[i]... | 30.151515 | 76 | 0.61608 | import numpy as np
import pandas as pd
import sys
import minimize as mini
import math
# f(x, y) = 100(y-x²)² + (1-x)²
def f(entry):
x, y = entry[0], entry[1]
return 100*(y-x**2)**2 + (1-x)**2
def grad_f(entry):
x, y = entry[0], entry[1]
return np.array([2*(200*x**3-200*x*y+x-1), 200*(y-x**2)])
def hess... | 6 | 0 | 0 | 0 | 0 | 248 | 0 | -23 | 132 |
710076b3af58b209ef0b6f76493745b202b4d562 | 2,510 | py | Python | python/torque-and-development.py | gajubadge11/hackerrank-3 | 132a5019b7ed21507bb95b5063fa66c446b0eff7 | [
"MIT"
] | 21 | 2015-02-09T18:08:38.000Z | 2021-11-08T15:00:48.000Z | python/torque-and-development.py | gajubadge11/hackerrank-3 | 132a5019b7ed21507bb95b5063fa66c446b0eff7 | [
"MIT"
] | 7 | 2020-04-12T23:00:19.000Z | 2021-01-30T23:44:24.000Z | python/torque-and-development.py | gajubadge11/hackerrank-3 | 132a5019b7ed21507bb95b5063fa66c446b0eff7 | [
"MIT"
] | 27 | 2015-07-22T18:08:12.000Z | 2022-02-28T19:50:26.000Z |
#!/bin/python3
import os
# Note the name of the file is based on this URL:
# https://www.hackerrank.com/challenges/torque-and-development/problem
# The problem name is "Roads and Libraries"
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
num_queries = int(input())
for _query in... | 27.582418 | 77 | 0.60239 |
#!/bin/python3
import math
import os
import random
import re
import sys
from collections import defaultdict
# Note the name of the file is based on this URL:
# https://www.hackerrank.com/challenges/torque-and-development/problem
# The problem name is "Roads and Libraries"
class DisjointSet:
def __init__(self,... | 0 | 0 | 0 | 1,107 | 0 | 576 | 0 | -27 | 157 |
8f3dca025adabe11f2e73709dd4ea46d5d23a0ed | 5,321 | py | Python | scripts/visualize.py | cannin/covid-sicr-test | f842946357428730265b7d0a6640172dc757ecae | [
"MIT"
] | null | null | null | scripts/visualize.py | cannin/covid-sicr-test | f842946357428730265b7d0a6640172dc757ecae | [
"MIT"
] | null | null | null | scripts/visualize.py | cannin/covid-sicr-test | f842946357428730265b7d0a6640172dc757ecae | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import argparse
import logging
from multiprocessing import Pool
import pandas as pd
from pathlib import Path
from tqdm import tqdm
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
for lib in ['blib2to3', 'papermill']:
logger = logging.getLogger(li... | 38.839416 | 79 | 0.631648 | #!/usr/bin/env python
# coding: utf-8
import argparse
import logging
from multiprocessing import Pool
import pandas as pd
import papermill as pm
from pathlib import Path
from tqdm import tqdm
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
for lib in ['blib2to3', 'papermill']:
logger... | 0 | 0 | 0 | 0 | 0 | 1,060 | 0 | 1 | 67 |
23a01d624ffefcd1efd212b7cac372fcf8f5665b | 2,642 | py | Python | lib/Serializer.py | oveis/DeepVideoFaceSwap | e507f94d4f5d74c36e41c386c6fb14bb745a4885 | [
"MIT"
] | 5 | 2019-05-17T11:54:04.000Z | 2020-10-06T18:45:17.000Z | lib/Serializer.py | oveis/DeepVideoFaceSwap | e507f94d4f5d74c36e41c386c6fb14bb745a4885 | [
"MIT"
] | 6 | 2020-03-04T23:21:03.000Z | 2020-07-23T07:46:40.000Z | lib/Serializer.py | oveis/DeepVideoFaceSwap | e507f94d4f5d74c36e41c386c6fb14bb745a4885 | [
"MIT"
] | 5 | 2019-06-05T00:20:24.000Z | 2019-09-15T15:40:23.000Z | #!/usr/bin/env python3
"""
Library providing convenient classes and methods for writing data to files.
"""
import logging
try:
import yaml
except ImportError:
yaml = None
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
def get_serializer(serializer):
""" Return requested seriali... | 25.161905 | 88 | 0.643452 | #!/usr/bin/env python3
"""
Library providing convenient classes and methods for writing data to files.
"""
import logging
import json
import pickle
try:
import yaml
except ImportError:
yaml = None
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
class Serializer():
""" Parent Seriali... | 0 | 678 | 0 | 585 | 0 | 0 | 0 | -18 | 136 |
0864eb168b511f133d3d02e20e4444df5f14ab23 | 926 | py | Python | pySnowRadar/timefunc.py | kingjml/pySnowRadar | a64721c3a84f255aa3bb9b872682a79969f7b1be | [
"MIT"
] | 4 | 2020-06-04T00:25:46.000Z | 2021-12-17T15:08:35.000Z | pySnowRadar/timefunc.py | kingjml/pySnowRadar | a64721c3a84f255aa3bb9b872682a79969f7b1be | [
"MIT"
] | 7 | 2020-02-19T11:34:26.000Z | 2020-10-02T12:52:17.000Z | pySnowRadar/timefunc.py | kingjml/pySnowRadar | a64721c3a84f255aa3bb9b872682a79969f7b1be | [
"MIT"
] | null | null | null | from bisect import bisect
from datetime import datetime
#Adapted from here https://stackoverflow.com/questions/33415475/how-to-get-current-date-and-time-from-gps-unsegment-time-in-python
_LEAP_DATES = ((1981, 6, 30), (1982, 6, 30), (1983, 6, 30),
(1985, 6, 30), (1987, 12, 31), (1989, 12, 31),
... | 42.090909 | 130 | 0.601512 | from bisect import bisect
from datetime import datetime
#Adapted from here https://stackoverflow.com/questions/33415475/how-to-get-current-date-and-time-from-gps-unsegment-time-in-python
_LEAP_DATES = ((1981, 6, 30), (1982, 6, 30), (1983, 6, 30),
(1985, 6, 30), (1987, 12, 31), (1989, 12, 31),
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ecbc24bc7d4b297e7efd8ceacf54947fdb42a15a | 703 | py | Python | noo/cli/components/config.py | nooproject/noo | 238711c55faeb1226a4e5339cd587a312c4babac | [
"MIT"
] | 2 | 2022-02-03T07:35:46.000Z | 2022-02-03T16:12:25.000Z | noo/cli/components/config.py | nooproject/noo | 238711c55faeb1226a4e5339cd587a312c4babac | [
"MIT"
] | 2 | 2022-03-05T02:31:38.000Z | 2022-03-05T21:26:42.000Z | noo/cli/components/config.py | nooproject/noo | 238711c55faeb1226a4e5339cd587a312c4babac | [
"MIT"
] | 1 | 2022-03-05T01:40:29.000Z | 2022-03-05T01:40:29.000Z | from typer import Typer
app = Typer()
ALLOWED_KEYS = {"shell", "index"}
| 19 | 76 | 0.559033 | from typer import Typer
from ...impl.utils import STORE, echo
app = Typer()
ALLOWED_KEYS = {"shell", "index"}
@app.command("set")
def set(key: str, value: str) -> None:
if key not in ALLOWED_KEYS:
echo(f"Invalid key: {key}")
return
if key == "shell":
if value not in {"allow", "den... | 0 | 541 | 0 | 0 | 0 | 0 | 0 | 16 | 69 |
d2b05002e02a97984c3d8bd84dccb5b850967d14 | 30,802 | py | Python | PR_BCI_team/Team_StarLab/DKHan/examples/openbmi_basic/datasets.py | PatternRecognition/OpenBMI | d9291ddb81f4319fb3764d7192e0363939a62ee9 | [
"MIT"
] | 217 | 2015-11-02T11:10:29.000Z | 2022-03-22T07:01:12.000Z | PR_BCI_team/Team_StarLab/DKHan/examples/openbmi_basic/datasets.py | deep-bci-g/OpenBMI | 75daf901b2dbe215852cbff243606dcfcd10f05c | [
"MIT"
] | 24 | 2015-11-02T11:10:45.000Z | 2021-09-08T11:10:33.000Z | PR_BCI_team/Team_StarLab/DKHan/examples/openbmi_basic/datasets.py | deep-bci-g/OpenBMI | 75daf901b2dbe215852cbff243606dcfcd10f05c | [
"MIT"
] | 112 | 2016-01-22T01:45:44.000Z | 2022-03-22T07:08:19.000Z | from __future__ import print_function
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.optim as optim
from torchvision import transforms
| 41.456258 | 189 | 0.483605 | from __future__ import print_function
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.sampler import Sub... | 249 | 0 | 0 | 29,003 | 113 | 916 | 0 | 67 | 453 |
72cabdebc468973bc9fbfb4027766d649c6732c2 | 692 | py | Python | detection/settings.py | HermasTV/uol_face_detection_recognition | 7622fb23c31651cb25fc995bcdaabffd8f24a1a1 | [
"MIT"
] | null | null | null | detection/settings.py | HermasTV/uol_face_detection_recognition | 7622fb23c31651cb25fc995bcdaabffd8f24a1a1 | [
"MIT"
] | null | null | null | detection/settings.py | HermasTV/uol_face_detection_recognition | 7622fb23c31651cb25fc995bcdaabffd8f24a1a1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""settings.py: detection module settings file """
__author__ = "Ahmed Hermas"
__copyright__ = "Copyright 2022, UOL "
__license__ = "MIT"
__version__ = "0.1.0"
__email__ = "a7medhermas@gmail.com"
MODELS_CONFIG = {
'hog' :
{'loader':'_hog_loader',
'detector':'_getface_hog... | 25.62963 | 50 | 0.599711 | #!/usr/bin/env python3
"""settings.py: detection module settings file """
__author__ = "Ahmed Hermas"
__copyright__ = "Copyright 2022, © UOL "
__license__ = "MIT"
__version__ = "0.1.0"
__email__ = "a7medhermas@gmail.com"
MODELS_CONFIG = {
'hog' :
{'loader':'_hog_loader',
'detector':'_getface_ho... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
faadb6c5aeddd3341afd44d8251b11ca503ccfc4 | 1,050 | py | Python | sped/efd/pis_cofins/arquivos.py | devmetalbr/python-sped | f6c95ff684df83386e9b60b1e05f2588b7d95a22 | [
"MIT"
] | null | null | null | sped/efd/pis_cofins/arquivos.py | devmetalbr/python-sped | f6c95ff684df83386e9b60b1e05f2588b7d95a22 | [
"MIT"
] | null | null | null | sped/efd/pis_cofins/arquivos.py | devmetalbr/python-sped | f6c95ff684df83386e9b60b1e05f2588b7d95a22 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from ... import arquivos
| 27.631579 | 46 | 0.668571 | # -*- coding: utf-8 -*-
from ... import arquivos
from . import blocos
from . import registros
from .blocos import Bloco0
from .blocos import Bloco1
from .blocos import Bloco9
from .blocos import BlocoA
from .blocos import BlocoC
from .blocos import BlocoD
from .blocos import BlocoF
from .blocos import BlocoI
from .blo... | 0 | 0 | 0 | 589 | 0 | 0 | 0 | 79 | 331 |
bc1de899bb63a3ca7eba1b31490b62c0ad47a355 | 16,732 | py | Python | register_dia.py | wangbiao0327/car | 2632de357107beeb240b330f20ec5ac5fb568beb | [
"MIT"
] | 1 | 2018-12-18T10:58:34.000Z | 2018-12-18T10:58:34.000Z | register_dia.py | wangbiao0327/car | 2632de357107beeb240b330f20ec5ac5fb568beb | [
"MIT"
] | null | null | null | register_dia.py | wangbiao0327/car | 2632de357107beeb240b330f20ec5ac5fb568beb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'register_dia.ui'
#
# Created by: PyQt5 UI code generator 5.11.2
#
# WARNING! All changes made in this file will be lost!
| 52.2875 | 197 | 0.70153 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'register_dia.ui'
#
# Created by: PyQt5 UI code generator 5.11.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Regist(object):
def setupUi(self, Regist):
... | 249 | 0 | 0 | 16,343 | 0 | 0 | 0 | 24 | 75 |
67b5f17d9eb7d26899f247ee9b7b0320a7966f8c | 651 | py | Python | scripts/basic/screenshot.py | Xp-speit2018/Warframe_Relic | a473f7e0e580e511807a4d62b9b04436b41301d8 | [
"Apache-2.0"
] | 3 | 2019-01-28T10:01:02.000Z | 2019-03-10T06:49:10.000Z | scripts/basic/screenshot.py | Xp-speit2018/Warframe_Relic | a473f7e0e580e511807a4d62b9b04436b41301d8 | [
"Apache-2.0"
] | null | null | null | scripts/basic/screenshot.py | Xp-speit2018/Warframe_Relic | a473f7e0e580e511807a4d62b9b04436b41301d8 | [
"Apache-2.0"
] | 1 | 2019-03-10T05:44:58.000Z | 2019-03-10T05:44:58.000Z | import time
import config
steam_screenshot_dir = config.get_config('steam_screenshot_dir')
if __name__ == '__main__':
time.sleep(3)
snapscreen()
time.sleep(0.5)
print(get_raw_location())
| 27.125 | 72 | 0.703533 | import os,sys,time,json
import win32api,win32con
import config
steam_screenshot_dir = config.get_config('steam_screenshot_dir')
def snapscreen():
win32api.keybd_event(123,0,0,0) #Press F12
win32api.keybd_event(123,0,win32con.KEYEVENTF_KEYUP,0) #Key F12 up
ctime = time.strftime('%Y_%m_%d_%H%M%S',time.local... | 0 | 0 | 0 | 0 | 0 | 363 | 0 | 15 | 68 |
c7dde020a302dd33538b8435327f578535ef5253 | 1,771 | py | Python | MADDPG/workspace/ddpg.py | Jeyhooon/deep-reinforcement-learning | 7a6f1974493a2058635539a4868512cdf3fb5bdb | [
"MIT"
] | null | null | null | MADDPG/workspace/ddpg.py | Jeyhooon/deep-reinforcement-learning | 7a6f1974493a2058635539a4868512cdf3fb5bdb | [
"MIT"
] | null | null | null | MADDPG/workspace/ddpg.py | Jeyhooon/deep-reinforcement-learning | 7a6f1974493a2058635539a4868512cdf3fb5bdb | [
"MIT"
] | null | null | null | # individual network settings for each actor + critic pair
# see networkforall for details
# add OU noise for exploration
#device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
device = 'cpu'
| 36.895833 | 114 | 0.706945 | # individual network settings for each actor + critic pair
# see networkforall for details
from networkforall import Network
from utilities import hard_update, gumbel_softmax, onehot_from_logits
from torch.optim import Adam
import torch
import numpy as np
# add OU noise for exploration
from OUNoise import OUNoise
#... | 0 | 0 | 0 | 1,342 | 0 | 0 | 0 | 61 | 156 |
321cb0062313080fdf84b7beef9c96569ebc2934 | 705 | py | Python | pyzkaccess/ctypes.py | cybrnode/pyzkaccess | 4d581035f65d25c8401453349ea311f7ce07ce27 | [
"Apache-2.0"
] | null | null | null | pyzkaccess/ctypes.py | cybrnode/pyzkaccess | 4d581035f65d25c8401453349ea311f7ce07ce27 | [
"Apache-2.0"
] | null | null | null | pyzkaccess/ctypes.py | cybrnode/pyzkaccess | 4d581035f65d25c8401453349ea311f7ce07ce27 | [
"Apache-2.0"
] | null | null | null | """This module is intended to safety import Windows-specific features
from `ctypes` stdlib module on non-windows platform -- they are
replaced by mock objects. Despite the code which uses that features
becomes partially unoperable in this case, we can import it and
generate documentation for instance
"""
import warning... | 35.25 | 94 | 0.739007 | """This module is intended to safety import Windows-specific features
from `ctypes` stdlib module on non-windows platform -- they are
replaced by mock objects. Despite the code which uses that features
becomes partially unoperable in this case, we can import it and
generate documentation for instance
"""
import warning... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 30 |
c288ee3fc0cf423ceaf08b833dc455121cad3417 | 904 | py | Python | analysis.py | Aveek-Saha/wordle-solver | b3bffc8d498416f37410aa3d6157893c0adaa3b7 | [
"MIT"
] | null | null | null | analysis.py | Aveek-Saha/wordle-solver | b3bffc8d498416f37410aa3d6157893c0adaa3b7 | [
"MIT"
] | null | null | null | analysis.py | Aveek-Saha/wordle-solver | b3bffc8d498416f37410aa3d6157893c0adaa3b7 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import json
import os
from collections import Counter
import pandas as pd
DATASET_DIR = 'datasets'
EXPERIMENT_DIR = 'combfreq'
RESULTS = os.path.join(DATASET_DIR, EXPERIMENT_DIR, 'simulation_results_scaled_tf.json')
RESULTS_EXTENDED = os.path.join(DATASET_DIR, EXPERIMENT_DIR, 'simulat... | 30.133333 | 106 | 0.75885 | import matplotlib.pyplot as plt
import json
import os
from collections import Counter
import pandas as pd
DATASET_DIR = 'datasets'
EXPERIMENT_DIR = 'combfreq'
RESULTS = os.path.join(DATASET_DIR, EXPERIMENT_DIR, 'simulation_results_scaled_tf.json')
RESULTS_EXTENDED = os.path.join(DATASET_DIR, EXPERIMENT_DIR, 'simulat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fc48aba289d448ad0ca5b0d020dd11686c9d2fc5 | 6,707 | py | Python | cinder/objects/cgsnapshot.py | alexisries/openstack-cinder | 7cc6e45c5ddb8bf771bdb01b867628e41761ae11 | [
"Apache-2.0"
] | 2 | 2019-05-24T14:13:50.000Z | 2019-05-24T14:21:13.000Z | cinder/objects/cgsnapshot.py | vexata/cinder | 7b84c0842b685de7ee012acec40fb4064edde5e9 | [
"Apache-2.0"
] | 28 | 2017-08-17T14:46:05.000Z | 2022-03-29T12:42:12.000Z | cinder/objects/cgsnapshot.py | vexata/cinder | 7b84c0842b685de7ee012acec40fb4064edde5e9 | [
"Apache-2.0"
] | 3 | 2017-04-27T16:11:40.000Z | 2020-02-12T21:27:00.000Z | # Copyright 2015 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 39.452941 | 78 | 0.627702 | # Copyright 2015 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 0 | 5,869 | 0 | 0 | 0 | 0 | 0 | 45 | 179 |
344a495fbf7cb9d4bfb0f99432929089c9febf24 | 6,363 | py | Python | src/client/__main__.py | guardian-network/webapp-poc | e9b2079117a52dc94b5fc5a181d1a1632ab8986c | [
"MIT"
] | null | null | null | src/client/__main__.py | guardian-network/webapp-poc | e9b2079117a52dc94b5fc5a181d1a1632ab8986c | [
"MIT"
] | 14 | 2019-04-26T02:44:01.000Z | 2019-10-09T18:09:48.000Z | src/client/__main__.py | guardian-network/webapp-poc | e9b2079117a52dc94b5fc5a181d1a1632ab8986c | [
"MIT"
] | null | null | null | # stdlib
import logging
# third party lib
# Internal lib
from lib import settings
# Routes
server_host = settings.ServerHTTP.external_host
server_port = settings.ServerHTTP.port
if __name__ == '__main__':
main()
| 36.153409 | 118 | 0.630677 | # stdlib
import argparse
import logging
import logging.config
import signal
import sys
import os
# third party lib
import requests
# Internal lib
from client.lib import shared
from lib import settings
import worker
from worker import factory
from lib.logging_config import return_client_config
# Routes
server_host =... | 0 | 131 | 0 | 382 | 0 | 5,248 | 0 | -8 | 381 |
f742af90db665ef1dbe10a4988b1ec91b7f78a5a | 421 | py | Python | src/discsocket/utils/__init__.py | murillotadeo/discsocket | 63d71e7623cf364c19398f00305816623ebc4a41 | [
"MIT"
] | null | null | null | src/discsocket/utils/__init__.py | murillotadeo/discsocket | 63d71e7623cf364c19398f00305816623ebc4a41 | [
"MIT"
] | null | null | null | src/discsocket/utils/__init__.py | murillotadeo/discsocket | 63d71e7623cf364c19398f00305816623ebc4a41 | [
"MIT"
] | null | null | null |
# Set interaction opcodes
DISPATCH = 0
HEARTBEAT = 1
IDENTIFY = 2
RESUME = 6
RECONNECT = 7
INVALID_SESSION = 9
HELLO = 10
HEARTBEAT_ACK = 11
# Set application command types
SLASH = 2
USER = 2
MESSAGE = 3
# Set message response types
CHANNEL_WITH_SOURCE = 4
DEFERRED_CHANNEL_WITH_SOURCE = 5
DEFERRED_UPDATE_MESSAGE = 6... | 16.84 | 34 | 0.769596 | from .cdn import return_cdn_avatar
# Set interaction opcodes
DISPATCH = 0
HEARTBEAT = 1
IDENTIFY = 2
RESUME = 6
RECONNECT = 7
INVALID_SESSION = 9
HELLO = 10
HEARTBEAT_ACK = 11
# Set application command types
SLASH = 2
USER = 2
MESSAGE = 3
# Set message response types
CHANNEL_WITH_SOURCE = 4
DEFERRED_CHANNEL_WITH_SOU... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 22 |
e0fd27db80019587e501e65dd937b6d7e19d2f78 | 1,052 | py | Python | tests/keepgoing/keepgoing_smtc.py | YosysHQ/sby | d10e472edf4ea9be3aa6347b264ba575fbea933a | [
"0BSD"
] | 14 | 2021-12-22T23:59:18.000Z | 2022-03-26T14:13:18.000Z | tests/keepgoing/keepgoing_smtc.py | YosysHQ/sby | d10e472edf4ea9be3aa6347b264ba575fbea933a | [
"0BSD"
] | 13 | 2022-01-11T18:07:40.000Z | 2022-03-31T10:42:19.000Z | tests/keepgoing/keepgoing_smtc.py | YosysHQ/sby | d10e472edf4ea9be3aa6347b264ba575fbea933a | [
"0BSD"
] | 2 | 2022-03-08T12:52:09.000Z | 2022-03-21T17:14:36.000Z | import sys
workdir = sys.argv[1]
src = "keepgoing_same_step.sv"
assert_a = line_ref(workdir, src, "assert(a)")
assert_not_a = line_ref(workdir, src, "assert(!a)")
assert_0 = line_ref(workdir, src, "assert(0)")
assert_false = line_ref(workdir, "extra.smtc", "assert false")
assert_distinct = line_ref(workdir, "extra.s... | 40.461538 | 107 | 0.696768 | import sys
from check_output import *
workdir = sys.argv[1]
src = "keepgoing_same_step.sv"
assert_a = line_ref(workdir, src, "assert(a)")
assert_not_a = line_ref(workdir, src, "assert(!a)")
assert_0 = line_ref(workdir, src, "assert(0)")
assert_false = line_ref(workdir, "extra.smtc", "assert false")
assert_distinct =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 22 |
2e54b7a573a5ba7cb864e05235a21c0ef097ec7f | 27,408 | py | Python | make_prg/make_prg_from_msa.py | martinghunt/make_prg | 86dbeebd02a7d7350700cd65874e244130aeda9a | [
"MIT"
] | null | null | null | make_prg/make_prg_from_msa.py | martinghunt/make_prg | 86dbeebd02a7d7350700cd65874e244130aeda9a | [
"MIT"
] | null | null | null | make_prg/make_prg_from_msa.py | martinghunt/make_prg | 86dbeebd02a7d7350700cd65874e244130aeda9a | [
"MIT"
] | null | null | null | import logging
from make_prg import utils
remove_duplicates = utils.remove_duplicates
contains_only = utils.contains_only
def get_interval_seqs(interval_alignment):
"""Replace - with nothing, remove seqs containing N or other non-allowed letters
and duplicate sequences containing RYKMSW, replacing with AGCT a... | 55.707317 | 176 | 0.561332 | import os
from Bio import AlignIO
from Bio.AlignIO import MultipleSeqAlignment
import logging
from sklearn.cluster import KMeans
import numpy as np
import gzip
from make_prg import utils
remove_duplicates = utils.remove_duplicates
contains_only = utils.contains_only
def get_interval_seqs(interval_alignment):
"""R... | 0 | 7,482 | 0 | 18,014 | 0 | 0 | 0 | 13 | 155 |
5a20ff39c8e140802ee50e344bbcc30c7ace2dbd | 7,598 | py | Python | trainOps.py | ricvolpi/generalize-unseen-domains | 99325ba9adce1a316b4994e7451657e5ec87d5a7 | [
"MIT"
] | 113 | 2018-09-14T14:46:02.000Z | 2022-03-16T17:52:17.000Z | trainOps.py | ricvolpi/generalize-unseen-domains | 99325ba9adce1a316b4994e7451657e5ec87d5a7 | [
"MIT"
] | 1 | 2018-12-13T15:22:02.000Z | 2021-05-18T06:30:11.000Z | trainOps.py | ricvolpi/generalize-unseen-domains | 99325ba9adce1a316b4994e7451657e5ec87d5a7 | [
"MIT"
] | 17 | 2018-09-15T21:55:42.000Z | 2021-08-31T06:45:04.000Z | import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
import numpy.random as npr
import os
import cPickle
import scipy.io
import sys
import glob
from numpy.linalg import norm
from scipy import misc
import utils
if __name__=='__main__':
print '...'
| 35.671362 | 185 | 0.729402 | import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
import numpy.random as npr
from ConfigParser import *
import os
import cPickle
import scipy.io
import sys
import glob
from numpy.linalg import norm
from scipy import misc
import utils
class TrainOps(object):
def __init__(self, mode... | 0 | 0 | 0 | 7,262 | 0 | 0 | 0 | 5 | 45 |
504a6b8e3f2d53545cf22926ac4fc990768b1c95 | 1,282 | py | Python | bdl_query.py | ppiatkowski/bdl-gus-playground | 1f5410b3757fe24525558cc315572e7ceb972fda | [
"MIT"
] | null | null | null | bdl_query.py | ppiatkowski/bdl-gus-playground | 1f5410b3757fe24525558cc315572e7ceb972fda | [
"MIT"
] | null | null | null | bdl_query.py | ppiatkowski/bdl-gus-playground | 1f5410b3757fe24525558cc315572e7ceb972fda | [
"MIT"
] | null | null | null | #!/usr/bin/python3
| 27.869565 | 94 | 0.559282 | #!/usr/bin/python3
from bdl_requests.bdl_request import *
from logger import logger
class BDLMultiVariableQuery(object):
def __init__(self, variables, city, year):
self.variables = variables
self.city = city
self.year = year
def execute(self):
vals = []
for variable i... | 0 | 0 | 0 | 1,149 | 0 | 0 | 0 | 21 | 91 |
53b354c028acadeebd22150ab1c00c9a7022be0d | 570 | py | Python | examples/fetch_scp_173.py | CSharperMantle/scp-fetcher-bs4 | 16d4c9b743c617abf145506151eb076ece4cb143 | [
"MIT"
] | 1 | 2021-04-04T05:38:12.000Z | 2021-04-04T05:38:12.000Z | examples/fetch_scp_173.py | CSharperMantle/scp_fetcher_bs4 | 16d4c9b743c617abf145506151eb076ece4cb143 | [
"MIT"
] | null | null | null | examples/fetch_scp_173.py | CSharperMantle/scp_fetcher_bs4 | 16d4c9b743c617abf145506151eb076ece4cb143 | [
"MIT"
] | null | null | null | from scp_fetcher_bs4.scp_info import SCPInfo, SCPParsingError
import requests
_TEMPLATE = """
Information about SCP-{0}:
\tObject Class: {1}
"""
def fetch_scp_173():
"""
Fetch the information about SCP-173 from http://scp-wiki.wikidot.com
"""
req = requests.get('http://scp-wiki.wikidot.com/scp-173')... | 20.357143 | 72 | 0.675439 | from scp_fetcher_bs4.scp_info import SCPInfo, SCPParsingError
import requests
_TEMPLATE = """
Information about SCP-{0}:
\tObject Class: {1}
"""
def fetch_scp_173():
"""
Fetch the information about SCP-173 from http://scp-wiki.wikidot.com
"""
req = requests.get('http://scp-wiki.wikidot.com/scp-173')... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
179491ffc82ce7ac2161bf57b7bf6c5238a686f5 | 4,795 | py | Python | fcis/operator_py/graph_cut.py | jeremy43/FCIS | 0ed234c14d064b615d6c2553edca24031b8c7c84 | [
"Apache-2.0"
] | null | null | null | fcis/operator_py/graph_cut.py | jeremy43/FCIS | 0ed234c14d064b615d6c2553edca24031b8c7c84 | [
"Apache-2.0"
] | null | null | null | fcis/operator_py/graph_cut.py | jeremy43/FCIS | 0ed234c14d064b615d6c2553edca24031b8c7c84 | [
"Apache-2.0"
] | null | null | null | # --------------------------------------------------------
#
# Copyright (c) 2017 Microsoft
# Licensed under The Apache-2.0 License [see LICENSE for details]
# Written by Shuhao Fu
# --------------------------------------------------------
"""
Proposal Target Operator selects foreground and background roi and ... | 42.061404 | 148 | 0.559124 | # --------------------------------------------------------
#
# Copyright (c) 2017 Microsoft
# Licensed under The Apache-2.0 License [see LICENSE for details]
# Written by Shuhao Fu
# --------------------------------------------------------
"""
Proposal Target Operator selects foreground and background roi and ... | 0 | 840 | 0 | 3,409 | 0 | 0 | 0 | 12 | 144 |
bb995ef516eb86dc3916d53f5c2e9f2ce04d40a8 | 2,017 | py | Python | common/geometery_test.py | jcl5m1/CVToolsPython | 02f5911abbc6463c96c12a55acb043230dc2b30c | [
"Apache-2.0"
] | 3 | 2015-05-12T08:01:46.000Z | 2020-08-15T08:56:25.000Z | common/geometery_test.py | jcl5m1/CVToolsPython | 02f5911abbc6463c96c12a55acb043230dc2b30c | [
"Apache-2.0"
] | null | null | null | common/geometery_test.py | jcl5m1/CVToolsPython | 02f5911abbc6463c96c12a55acb043230dc2b30c | [
"Apache-2.0"
] | 1 | 2020-03-30T09:02:45.000Z | 2020-03-30T09:02:45.000Z | __author__ = 'johnnylee'
import geometery as geo
import random
import matplotlib
matplotlib.use('Qt4Agg')
import matplotlib.pyplot as plt
import numpy as np
import math
import transformations as xforms
import sys
points = np.zeros((4, 2))
fig = plt.figure()
ax = fig.add_subplot(111, aspect='equal', xlim=(0, 1), ylim... | 24.901235 | 85 | 0.661874 | __author__ = 'johnnylee'
import geometery as geo
import random
import matplotlib
matplotlib.use('Qt4Agg')
import matplotlib.pyplot as plt
import numpy as np
import math
import transformations as xforms
import sys
points = np.zeros((4, 2))
fig = plt.figure()
ax = fig.add_subplot(111, aspect='equal', xlim=(0, 1), ylim... | 0 | 0 | 0 | 0 | 0 | 1,033 | 0 | 0 | 69 |
a1b3e09eea57315dbff69ecb4a21d733728fc5da | 19,957 | py | Python | momba/model/context.py | koehlma/momba | 68d6431d2732570696d3c67a9e23006e6e3a7740 | [
"MIT"
] | 12 | 2021-01-18T14:38:32.000Z | 2022-01-17T09:16:52.000Z | momba/model/context.py | koehlma/momba | 68d6431d2732570696d3c67a9e23006e6e3a7740 | [
"MIT"
] | 3 | 2021-05-16T15:26:34.000Z | 2022-02-21T20:46:55.000Z | momba/model/context.py | koehlma/momba | 68d6431d2732570696d3c67a9e23006e6e3a7740 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
#
# Copyright (C) 2019-2021, Saarland University
# Copyright (C) 2019-2021, Maximilian Khl <koehl@cs.uni-saarland.de>
from __future__ import annotations
_CLOCK_TYPES = {
ModelType.TA,
ModelType.PTA,
ModelType.STA,
ModelType.HA,
ModelType.PHA,
ModelType.SHA,
}
_UNTIMED... | 30.468702 | 94 | 0.612166 | # -*- coding:utf-8 -*-
#
# Copyright (C) 2019-2021, Saarland University
# Copyright (C) 2019-2021, Maximilian Köhl <koehl@cs.uni-saarland.de>
from __future__ import annotations
import dataclasses as d
import typing as t
import collections
import enum
from . import actions, errors, functions, expressions, types
fro... | 2 | 5,665 | 0 | 13,426 | 0 | 0 | 0 | 43 | 318 |
38f8473d78176bc1f32cdcfbebfe93d331b34287 | 358 | py | Python | comunicados/migrations/0014_auto_20180125_1055.py | MonkeyAndres/AlexioProject | 561fdbbfb561bb2ee40c6e90696ba4759029959d | [
"MIT"
] | null | null | null | comunicados/migrations/0014_auto_20180125_1055.py | MonkeyAndres/AlexioProject | 561fdbbfb561bb2ee40c6e90696ba4759029959d | [
"MIT"
] | null | null | null | comunicados/migrations/0014_auto_20180125_1055.py | MonkeyAndres/AlexioProject | 561fdbbfb561bb2ee40c6e90696ba4759029959d | [
"MIT"
] | null | null | null | # Generated by Django 2.0.1 on 2018-01-25 10:55
| 19.888889 | 51 | 0.625698 | # Generated by Django 2.0.1 on 2018-01-25 10:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('comunicados', '0013_auto_20171211_1020'),
]
operations = [
migrations.RenameModel(
old_name='DocumentoComunicado',
new_name=... | 0 | 0 | 0 | 252 | 0 | 0 | 0 | 11 | 46 |
374eaf0a682a8b46c44a35d2f12edd86ef24bcb3 | 4,847 | py | Python | tatsumakibot.py | boosungkim/TatsuBot | 36d4afce6bc637150876d99caa35c27f1104835c | [
"MIT"
] | 1 | 2019-06-23T13:18:01.000Z | 2019-06-23T13:18:01.000Z | tatsumakibot.py | boosungkim/TatsuBot | 36d4afce6bc637150876d99caa35c27f1104835c | [
"MIT"
] | 1 | 2021-06-01T23:51:54.000Z | 2021-06-01T23:51:54.000Z | tatsumakibot.py | boosungkim/TatsuBot | 36d4afce6bc637150876d99caa35c27f1104835c | [
"MIT"
] | null | null | null |
# The main functions of the bot
print("About to run bot")
if __name__ == "__main__":
cache = []
main()
| 51.56383 | 185 | 0.605323 | import praw
import time
from praw.exceptions import APIException
import re
def authenticate():
print("Authenticating...")
reddit = praw.Reddit(
'TatsuBot',
user_agent="Tatsumaki comment responder v1.2.2")
print("Authenticated as {}!".format(reddit.user.me()... | 0 | 0 | 0 | 0 | 0 | 4,587 | 0 | -13 | 156 |
8c41beca163efaf1a35c57412fdbbf8b236afbc1 | 758 | py | Python | function/migrations/0003_auto_20210223_2023.py | 160012/EDAS | 25c98187cd4dc24e45dc9b305760b4451c76afb7 | [
"MIT"
] | null | null | null | function/migrations/0003_auto_20210223_2023.py | 160012/EDAS | 25c98187cd4dc24e45dc9b305760b4451c76afb7 | [
"MIT"
] | null | null | null | function/migrations/0003_auto_20210223_2023.py | 160012/EDAS | 25c98187cd4dc24e45dc9b305760b4451c76afb7 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-02-23 12:23
| 26.137931 | 81 | 0.580475 | # Generated by Django 3.1.4 on 2021-02-23 12:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('function', '0002_curriculum_method'),
]
operations = [
migrations.AddField(
model_name='curriculum',
name='id',
... | 18 | 0 | 0 | 638 | 0 | 0 | 0 | 19 | 46 |
a8768925d360b3fa33286df29995237f80ab58b0 | 10,576 | py | Python | Project2_logic/logicPlan.py | mtroym/CS181-CS-188-UCB- | e84d1d5118a0a8864ba0c44dd17777699c28c123 | [
"MIT"
] | 3 | 2021-06-17T07:34:16.000Z | 2022-02-21T16:45:27.000Z | Project2_logic/logicPlan.py | MTonyM/CS181-CS-188-UCB- | e84d1d5118a0a8864ba0c44dd17777699c28c123 | [
"MIT"
] | null | null | null | Project2_logic/logicPlan.py | MTonyM/CS181-CS-188-UCB- | e84d1d5118a0a8864ba0c44dd17777699c28c123 | [
"MIT"
] | 1 | 2020-10-01T14:32:04.000Z | 2020-10-01T14:32:04.000Z | # logicPlan.py
# ------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.edu.
... | 36.095563 | 154 | 0.627553 | # logicPlan.py
# ------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.edu.
... | 0 | 0 | 0 | 835 | 0 | 0 | 0 | -20 | 68 |