hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20f1c19c7606a945ba3892e00a1ae7a99f12469c | 4,976 | py | Python | html_form_to_dict/tests/test_html_form_to_dict.py | jeanmonet/html_form_to_dict | 87231fdebafe84c97bfb9075d7e307c1ef9e0da9 | [
"MIT"
] | 3 | 2021-12-07T08:13:23.000Z | 2022-03-11T13:39:54.000Z | html_form_to_dict/tests/test_html_form_to_dict.py | jeanmonet/html_form_to_dict | 87231fdebafe84c97bfb9075d7e307c1ef9e0da9 | [
"MIT"
] | null | null | null | html_form_to_dict/tests/test_html_form_to_dict.py | jeanmonet/html_form_to_dict | 87231fdebafe84c97bfb9075d7e307c1ef9e0da9 | [
"MIT"
] | 2 | 2021-11-18T03:15:52.000Z | 2021-12-07T08:12:49.000Z | import pytest
from html_form_to_dict import html_form_to_dict
| 31.1 | 118 | 0.6041 | import pytest
from html_form_to_dict import html_form_to_dict
def test_html_form_to_dict__empty():
html = '''
<form>
<input type="text" name="my-input">
<textarea name="my-textarea">\n</textarea>
</form>'''
assert html_form_to_dict(html) == {'my-input': '', 'my-textarea': ''}
def test_html_f... | 4,597 | -3 | 310 |
d73b0fea5a4bc664dd777117433934844b951fca | 2,178 | py | Python | asgan/aligner.py | epolevikov/Asgan | 098490af8266ecbe5ddfbceccdbcb478b8b0e538 | [
"MIT"
] | 27 | 2019-06-20T09:49:42.000Z | 2021-10-03T02:25:21.000Z | asgan/aligner.py | epolevikov/Asgan | 098490af8266ecbe5ddfbceccdbcb478b8b0e538 | [
"MIT"
] | 2 | 2019-06-21T08:04:50.000Z | 2021-12-18T09:42:34.000Z | asgan/aligner.py | epolevikov/Asgan | 098490af8266ecbe5ddfbceccdbcb478b8b0e538 | [
"MIT"
] | null | null | null | import os
from asgan.output_generator import pretty_number
| 29.432432 | 77 | 0.642792 | import os
from asgan.output_generator import pretty_number
class RawPafHit:
def __init__(self, raw_hit):
raw_hit = raw_hit.strip().split()
self.query_name = raw_hit[0]
self.query_len = int(raw_hit[1])
self.query_start = int(raw_hit[2])
self.query_end = int(raw_hit[3])
... | 1,918 | -5 | 203 |
ed244b9458bb0d972e76b33be41d88e4b8b0de9f | 8,107 | py | Python | cdsdashboards/builder/builders.py | slemonide/cdsdashboards | 848be1755c0c82f05df0bd7cbd28e5546f78c8d8 | [
"BSD-3-Clause"
] | 1 | 2020-11-12T20:40:36.000Z | 2020-11-12T20:40:36.000Z | cdsdashboards/builder/builders.py | sagarmk/cdsdashboards | 292069f62f6977f1d9175099be9ee6cf813a67b2 | [
"BSD-3-Clause"
] | null | null | null | cdsdashboards/builder/builders.py | sagarmk/cdsdashboards | 292069f62f6977f1d9175099be9ee6cf813a67b2 | [
"BSD-3-Clause"
] | 1 | 2021-08-04T09:20:54.000Z | 2021-08-04T09:20:54.000Z | from asyncio import sleep
from datetime import datetime
from traitlets.config import LoggingConfigurable
from traitlets import Any, Bool, Integer
from tornado.log import app_log
class Builder(LoggingConfigurable):
"""Base class for building a dashboard, e.g. by cloning an existing server which is a Docker contai... | 28.545775 | 114 | 0.602689 | from asyncio import sleep
from datetime import datetime
from traitlets.config import LoggingConfigurable
from traitlets import Any, Bool, Integer
from tornado.log import app_log
class Builder(LoggingConfigurable):
"""Base class for building a dashboard, e.g. by cloning an existing server which is a Docker contai... | 984 | 24 | 206 |
fb4c7eec041a313384be9ffc38ff825339361c00 | 2,207 | py | Python | odd_collector/adapters/feast/mappers/datasets.py | opendatadiscovery/odd-collector | a7f83b10c71c8049d95b388ad844e7c55b9ea19d | [
"Apache-2.0"
] | null | null | null | odd_collector/adapters/feast/mappers/datasets.py | opendatadiscovery/odd-collector | a7f83b10c71c8049d95b388ad844e7c55b9ea19d | [
"Apache-2.0"
] | null | null | null | odd_collector/adapters/feast/mappers/datasets.py | opendatadiscovery/odd-collector | a7f83b10c71c8049d95b388ad844e7c55b9ea19d | [
"Apache-2.0"
] | null | null | null | from typing import Dict
from feast.entity import Entity
from feast.feature_view import FeatureView
from google.protobuf.json_format import MessageToDict
from more_itertools import flatten
from odd_models.models import DataEntity, DataSet, DataEntityType
from oddrn_generator import FeastGenerator
from . import metadat... | 36.783333 | 84 | 0.659266 | from typing import Dict
from feast.entity import Entity
from feast.feature_view import FeatureView
from google.protobuf.json_format import MessageToDict
from more_itertools import flatten
from odd_models.models import DataEntity, DataSet, DataEntityType
from oddrn_generator import FeastGenerator
from . import metadat... | 1,773 | 3 | 76 |
1f1c3e83bf952886047f8d35242e92f2f114e2f7 | 1,247 | py | Python | test_tool/update_count_show.py | YaoYinYing/HZAU_DDNS | 9fbf131b6b8e62184a855aa9635b81c08657e869 | [
"MIT"
] | null | null | null | test_tool/update_count_show.py | YaoYinYing/HZAU_DDNS | 9fbf131b6b8e62184a855aa9635b81c08657e869 | [
"MIT"
] | null | null | null | test_tool/update_count_show.py | YaoYinYing/HZAU_DDNS | 9fbf131b6b8e62184a855aa9635b81c08657e869 | [
"MIT"
] | null | null | null | #!python
import sqlite3
import time,datetime
import traceback
import cgi
hide_column = 1
print("content-type:text/html")
print("")
print("<meta http-equiv = 'refresh' content = 30 />")
ddns_count_show()
| 29 | 120 | 0.561347 | #!python
import sqlite3
import time,datetime
import traceback
import cgi
hide_column = 1
def ddns_count_show():
conn = sqlite3.connect("sqlite file")
c = conn.cursor()
sql = '''SELECT * FROM DDNS_UPDATE_COUNT;'''
print("<html><table border='2' cellspacing='0'> ")
print("<thead><tr>")
for x in... | 1,020 | 0 | 23 |
0dc64f8ae704ec237d0246c8e0752c0b10a0bb95 | 1,969 | py | Python | tensorflow/python/kernel_tests/array_ops_test.py | deepakmuralidharan/tensorflow | f40e41f9c71ef2865f96f3db3cea2909797fe2a3 | [
"Apache-2.0"
] | 23 | 2016-02-04T21:08:43.000Z | 2022-01-14T13:22:33.000Z | tensorflow/python/kernel_tests/array_ops_test.py | deepakmuralidharan/tensorflow | f40e41f9c71ef2865f96f3db3cea2909797fe2a3 | [
"Apache-2.0"
] | 2 | 2016-05-31T16:38:55.000Z | 2018-12-30T20:17:05.000Z | tensorflow/python/kernel_tests/array_ops_test.py | deepakmuralidharan/tensorflow | f40e41f9c71ef2865f96f3db3cea2909797fe2a3 | [
"Apache-2.0"
] | 20 | 2016-02-15T17:31:02.000Z | 2020-01-12T08:18:48.000Z | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 30.292308 | 80 | 0.70645 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 685 | 60 | 146 |
8926fe6e7a12d8d148d34c4f86ab4d7e29194c4b | 6,692 | py | Python | tools/harness/tests/devif_test.py | summergirl21/Barrelfish | b224df87e9da52e9bf33e21eddf43a6a6e2f0efc | [
"MIT"
] | 1 | 2018-06-01T20:26:24.000Z | 2018-06-01T20:26:24.000Z | tools/harness/tests/devif_test.py | summergirl21/Barrelfish | b224df87e9da52e9bf33e21eddf43a6a6e2f0efc | [
"MIT"
] | null | null | null | tools/harness/tests/devif_test.py | summergirl21/Barrelfish | b224df87e9da52e9bf33e21eddf43a6a6e2f0efc | [
"MIT"
] | null | null | null | ##########################################################################
# Copyright (c) 2017, ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092... | 30.280543 | 108 | 0.608338 | ##########################################################################
# Copyright (c) 2017, ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092... | 3,948 | 8 | 527 |
62797df22dd100b812713477ca51cd2c107a8c73 | 2,018 | py | Python | src/models/blog.py | YukinoKoh/multiuser_blog_template | 8d42f0ea7a905d0ae1602e12c569d15e48aaa062 | [
"MIT"
] | 1 | 2019-04-18T23:36:14.000Z | 2019-04-18T23:36:14.000Z | src/models/blog.py | YukinoKoh/multiuser_blog_template | 8d42f0ea7a905d0ae1602e12c569d15e48aaa062 | [
"MIT"
] | null | null | null | src/models/blog.py | YukinoKoh/multiuser_blog_template | 8d42f0ea7a905d0ae1602e12c569d15e48aaa062 | [
"MIT"
] | null | null | null | from google.appengine.ext import db
from models import User
# Blog db
# check if blog exist, if so return blog
| 25.225 | 61 | 0.584737 | from google.appengine.ext import db
from models import User
# Blog db
def blog_key(name='default'):
return None
# return db.Key.from_path('posts', name)
# check if blog exist, if so return blog
def post_exists(blog_id):
return Blog.get_by_id(int(blog_id))
class Blog(db.Model):
user = db.ReferenceP... | 1,020 | 814 | 67 |
fa5f2aa7c77e9c856bf036a05613f1586141afb2 | 3,384 | py | Python | textanalyzerpy/urls.py | abindent/textanalyzer.py | 0d9c58adb491798d440d9fff33d2f1069d155014 | [
"BSD-3-Clause-Attribution"
] | 3 | 2022-02-13T08:15:39.000Z | 2022-02-13T08:33:04.000Z | textanalyzerpy/urls.py | abindent/textanalyzer.py | 0d9c58adb491798d440d9fff33d2f1069d155014 | [
"BSD-3-Clause-Attribution"
] | null | null | null | textanalyzerpy/urls.py | abindent/textanalyzer.py | 0d9c58adb491798d440d9fff33d2f1069d155014 | [
"BSD-3-Clause-Attribution"
] | null | null | null | """textanalyzerpy URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Clas... | 35.25 | 156 | 0.717494 | """textanalyzerpy URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Clas... | 0 | 0 | 0 |
51dbf5e327a0d8ffecdd82ac094f31464e5e42cd | 2,485 | py | Python | Interactive-Python/project-2-guess-the-number.py | ugaliguy/Python-at-Rice | b145a4475bdd3e9250f88a01dff894945d9b3e4b | [
"MIT"
] | null | null | null | Interactive-Python/project-2-guess-the-number.py | ugaliguy/Python-at-Rice | b145a4475bdd3e9250f88a01dff894945d9b3e4b | [
"MIT"
] | null | null | null | Interactive-Python/project-2-guess-the-number.py | ugaliguy/Python-at-Rice | b145a4475bdd3e9250f88a01dff894945d9b3e4b | [
"MIT"
] | 2 | 2020-11-09T16:06:28.000Z | 2020-12-07T07:42:47.000Z | # template for "Guess the number" mini-project
# input will come from buttons and an input field
# all output for the game will be printed in the console
import simplegui
import random
import math
number_range = 100
player_guess = 0
secret_number = 0
number_of_guesses = 7
counter = 7
# helper function to... | 30.679012 | 77 | 0.665594 | # template for "Guess the number" mini-project
# input will come from buttons and an input field
# all output for the game will be printed in the console
import simplegui
import random
import math
number_range = 100
player_guess = 0
secret_number = 0
number_of_guesses = 7
counter = 7
# helper function to... | 1,579 | 0 | 100 |
919aea3ba60810cf24f794032d2c52fd30917322 | 22,840 | py | Python | ostap/io/rootshelve.py | TatianaOvsiannikova/ostap | a005a78b4e2860ac8f4b618e94b4b563b2eddcf1 | [
"BSD-3-Clause"
] | null | null | null | ostap/io/rootshelve.py | TatianaOvsiannikova/ostap | a005a78b4e2860ac8f4b618e94b4b563b2eddcf1 | [
"BSD-3-Clause"
] | null | null | null | ostap/io/rootshelve.py | TatianaOvsiannikova/ostap | a005a78b4e2860ac8f4b618e94b4b563b2eddcf1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
# @file rootshelve.py
#
# This is shelve-like database with ROOT.TFile as internal storage
#
# @see zipshelve
# @see sqliteshelve
#
#
# Create new DB:
#
# @code
#
# >>> import rootshelve as DB... | 36.602564 | 136 | 0.462653 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
# @file rootshelve.py
#
# This is shelve-like database with ROOT.TFile as internal storage
#
# @see zipshelve
# @see sqliteshelve
#
#
# Create new DB:
#
# @code
#
# >>> import rootshelve as DB... | 1,882 | 0 | 246 |
0ff674b078af01d36e2acd0636fba0a3a5ce2be7 | 75 | py | Python | conftest.py | kevinyamauchi/model-runner | 77261bcd293de87533776291f44a09bf28a3c845 | [
"BSD-3-Clause"
] | null | null | null | conftest.py | kevinyamauchi/model-runner | 77261bcd293de87533776291f44a09bf28a3c845 | [
"BSD-3-Clause"
] | 5 | 2021-09-27T14:43:39.000Z | 2022-02-23T14:18:00.000Z | conftest.py | kevinyamauchi/model-runner | 77261bcd293de87533776291f44a09bf28a3c845 | [
"BSD-3-Clause"
] | null | null | null | pytest_plugins = ["model_runner.validator._tests.validator_test_fixtures"]
| 37.5 | 74 | 0.853333 | pytest_plugins = ["model_runner.validator._tests.validator_test_fixtures"]
| 0 | 0 | 0 |
90793aabb0491b9c123b0908c90a6985ab695e9a | 1,271 | py | Python | big-data-analytics/cache-camelot-final/gen_gif.py | robertwenquan/nyu-course-assignment | c03a4fb157d385b650c38feb861f283f2e1928fd | [
"Apache-2.0"
] | 1 | 2018-01-22T21:35:42.000Z | 2018-01-22T21:35:42.000Z | big-data-analytics/cache-camelot-final/gen_gif.py | robertwenquan/nyu-course-assignment | c03a4fb157d385b650c38feb861f283f2e1928fd | [
"Apache-2.0"
] | null | null | null | big-data-analytics/cache-camelot-final/gen_gif.py | robertwenquan/nyu-course-assignment | c03a4fb157d385b650c38feb861f283f2e1928fd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""
INPUT: A file named specified from the command line
The file is a single line JSON format like this:
["424344455354X738492939495", "424344535463X738492939495"]
each element represents a game canvass map
INTERMEDIATE OUTPUT: a series of png files numbered from 0
... | 27.042553 | 87 | 0.656963 | #!/usr/bin/python
"""
INPUT: A file named specified from the command line
The file is a single line JSON format like this:
["424344455354X738492939495", "424344535463X738492939495"]
each element represents a game canvass map
INTERMEDIATE OUTPUT: a series of png files numbered from 0
... | 0 | 0 | 0 |
f57465d9f041be181241cf38ddff4ee4c439fed6 | 1,312 | py | Python | runflight.py | feynfan13/transtory | 4dd48033fdcd95b4a0dbc19f5b26d15b4b533979 | [
"MIT"
] | 1 | 2018-12-20T08:05:11.000Z | 2018-12-20T08:05:11.000Z | runflight.py | feynfan13/transtory | 4dd48033fdcd95b4a0dbc19f5b26d15b4b533979 | [
"MIT"
] | null | null | null | runflight.py | feynfan13/transtory | 4dd48033fdcd95b4a0dbc19f5b26d15b4b533979 | [
"MIT"
] | null | null | null | import sys
import argparse
from transtory.flight import logger, switch_to_test_mode
from transtory.flight import get_public_data_app
from transtory.flight import FlightRecorder, FlightTripStats, FlightPlaneStats
parser = argparse.ArgumentParser(description="Flight database command.")
parser.add_argument("--testmode... | 30.511628 | 84 | 0.757622 | import sys
import argparse
from transtory.flight import logger, switch_to_test_mode
from transtory.flight import get_public_data_app
from transtory.flight import FlightRecorder, FlightTripStats, FlightPlaneStats
def save_all_stats():
stator = FlightTripStats()
stator.save_all_stats()
stator = FlightPlane... | 119 | 0 | 23 |
a3fcae735fe5684eb09fac3ada0fd2ebf49ca307 | 23,191 | py | Python | tests/selenium/pmtests/postman_tests_requests.py | cdaapi/POSTMan-Chrome-Extension | ec2dc635f588fd5145853c8b6f4fc881b4c12632 | [
"Apache-2.0"
] | 113 | 2015-07-10T10:00:42.000Z | 2022-01-28T05:21:30.000Z | tests/selenium/pmtests/postman_tests_requests.py | ingenioustechie/postman | 9207f4fa108e6afec50021806dc45597b2e340a8 | [
"Apache-2.0"
] | 11 | 2015-07-21T17:16:50.000Z | 2020-01-14T19:51:31.000Z | tests/selenium/pmtests/postman_tests_requests.py | ingenioustechie/postman | 9207f4fa108e6afec50021806dc45597b2e340a8 | [
"Apache-2.0"
] | 63 | 2015-06-23T03:58:58.000Z | 2022-01-07T06:38:07.000Z | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.chrome.service as service
import tracebac... | 39.915663 | 158 | 0.677073 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.chrome.service as service
import tracebac... | 22,046 | 20 | 568 |
3f613b605a7e255057f88d1c855f93bd6a7561fe | 3,315 | py | Python | test/onnx_converter_test/train_scripts/gmf.py | rhdong/HugeCTR | b596bcc44e14bb0c62c4f7e9c0b55301d94f2154 | [
"Apache-2.0"
] | null | null | null | test/onnx_converter_test/train_scripts/gmf.py | rhdong/HugeCTR | b596bcc44e14bb0c62c4f7e9c0b55301d94f2154 | [
"Apache-2.0"
] | null | null | null | test/onnx_converter_test/train_scripts/gmf.py | rhdong/HugeCTR | b596bcc44e14bb0c62c4f7e9c0b55301d94f2154 | [
"Apache-2.0"
] | null | null | null | import hugectr
from mpi4py import MPI
solver = hugectr.CreateSolver(max_eval_batches = 1000,
batchsize_eval = 2770,
batchsize = 17548,
lr = 0.0045,
vvgpu = [[0]],
metrics... | 59.196429 | 137 | 0.500452 | import hugectr
from mpi4py import MPI
solver = hugectr.CreateSolver(max_eval_batches = 1000,
batchsize_eval = 2770,
batchsize = 17548,
lr = 0.0045,
vvgpu = [[0]],
metrics... | 0 | 0 | 0 |
e728cce5f55db6b596193b599a33a241cf579dcc | 542 | py | Python | Brownian/urls.py | FuzzyWaffler/Brownian | f05a351728ff7bb753a179a6966e673fb096b53c | [
"BSD-2-Clause"
] | 52 | 2015-01-10T05:02:00.000Z | 2019-12-19T02:17:13.000Z | Brownian/urls.py | FuzzyWaffler/Brownian | f05a351728ff7bb753a179a6966e673fb096b53c | [
"BSD-2-Clause"
] | 9 | 2015-05-04T10:28:07.000Z | 2020-02-11T21:09:26.000Z | Brownian/urls.py | grigorescu/Brownian | f05a351728ff7bb753a179a6966e673fb096b53c | [
"BSD-2-Clause"
] | 15 | 2015-01-10T05:02:04.000Z | 2019-06-11T02:56:17.000Z | from django.conf.urls import patterns, url, include
from dajaxice.core import dajaxice_autodiscover, dajaxice_config
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
dajaxice_autodiscover()
urlpatterns = patterns('',
url(dajaxice_config.dajaxice_url, include('dajaxice.urls')),
url(r'^$', 'B... | 38.714286 | 68 | 0.749077 | from django.conf.urls import patterns, url, include
from dajaxice.core import dajaxice_autodiscover, dajaxice_config
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
dajaxice_autodiscover()
urlpatterns = patterns('',
url(dajaxice_config.dajaxice_url, include('dajaxice.urls')),
url(r'^$', 'B... | 0 | 0 | 0 |
ac8997188cd3a74a5c084430fddbb04b71d440d2 | 5,579 | py | Python | app/script/parse.py | DanylZhang/Netflix-Genre | d68d5b01d8ba25e776edb5fca4f4295a7d3a55a1 | [
"MIT"
] | null | null | null | app/script/parse.py | DanylZhang/Netflix-Genre | d68d5b01d8ba25e776edb5fca4f4295a7d3a55a1 | [
"MIT"
] | 2 | 2021-05-09T17:55:15.000Z | 2021-12-13T19:58:57.000Z | app/script/parse.py | DanylZhang/Netflix-Genre | d68d5b01d8ba25e776edb5fca4f4295a7d3a55a1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding:utf-8
from gevent import monkey
monkey.patch_all()
from gevent.pool import Pool
from app.libs.PyMysqlPool import PyMysqlPool
from app.script.config import *
import pymysql
import time
from bs4 import BeautifulSoup
import re
thread_number = 40
pool = Pool(size=thread_number)
netflix_po... | 39.85 | 201 | 0.623051 | #!/usr/bin/env python
# coding:utf-8
from gevent import monkey
monkey.patch_all()
from gevent.pool import Pool
from app.libs.PyMysqlPool import PyMysqlPool
from app.script.config import *
import pymysql
import time
from bs4 import BeautifulSoup
import re
thread_number = 40
pool = Pool(size=thread_number)
netflix_po... | 5,122 | 0 | 69 |
13b9ea4a1890a47ed3a3bc1398db9cbdfe465c21 | 1,044 | py | Python | setup.py | panosz/alpha_shapes | b9c0b3c76993b3f267a01ed538ce47b2c5743542 | [
"MIT"
] | 5 | 2021-02-05T06:54:31.000Z | 2022-02-24T13:30:42.000Z | setup.py | panosz/alpha_shapes | b9c0b3c76993b3f267a01ed538ce47b2c5743542 | [
"MIT"
] | null | null | null | setup.py | panosz/alpha_shapes | b9c0b3c76993b3f267a01ed538ce47b2c5743542 | [
"MIT"
] | 2 | 2021-04-11T04:38:03.000Z | 2021-09-13T09:32:56.000Z | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
description = "reconstruct the shape of a 2D point cloud."
setup(name="alpha_shapes",
description=description,
author="Panagiotis Zestanakis",
author_email="panosz@gmail.com",
packa... | 33.677419 | 68 | 0.606322 | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
description = "reconstruct the shape of a 2D point cloud."
setup(name="alpha_shapes",
description=description,
author="Panagiotis Zestanakis",
author_email="panosz@gmail.com",
packa... | 0 | 0 | 0 |
731c960361d8fe524f2ddfe58ac57aa4776bbfdb | 2,588 | py | Python | analyse_templates.py | evanmiltenburg/EvaluationRules | 91de64adf2a11a18ab871e025ddea528c73430f0 | [
"MIT"
] | null | null | null | analyse_templates.py | evanmiltenburg/EvaluationRules | 91de64adf2a11a18ab871e025ddea528c73430f0 | [
"MIT"
] | null | null | null | analyse_templates.py | evanmiltenburg/EvaluationRules | 91de64adf2a11a18ab871e025ddea528c73430f0 | [
"MIT"
] | null | null | null | from lxml import etree
import glob
from collections import defaultdict, Counter
import json
def get_entries(xmlfile):
"Get entries from an XML file."
root = etree.parse(xmlfile)
return root.xpath('//entry')
def count_templates(filename):
"Count the templates for each predicate in a file."
templa... | 30.809524 | 78 | 0.659196 | from lxml import etree
import glob
from collections import defaultdict, Counter
import json
def get_entries(xmlfile):
"Get entries from an XML file."
root = etree.parse(xmlfile)
return root.xpath('//entry')
def count_templates(filename):
"Count the templates for each predicate in a file."
templa... | 0 | 0 | 0 |
14f1148905679d9655b18c93956eb27fdcb86aab | 1,260 | py | Python | app/car/tests/test_rates_api.py | raszidzie/cars-api | f212d59722fe37f3b2fc7f7f9d064c2a614a9d20 | [
"MIT"
] | 1 | 2021-02-05T07:10:55.000Z | 2021-02-05T07:10:55.000Z | app/car/tests/test_rates_api.py | raszidzie/cars-api | f212d59722fe37f3b2fc7f7f9d064c2a614a9d20 | [
"MIT"
] | null | null | null | app/car/tests/test_rates_api.py | raszidzie/cars-api | f212d59722fe37f3b2fc7f7f9d064c2a614a9d20 | [
"MIT"
] | null | null | null | from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Rate
from car.tests.test_cars_api import sample_car
RATE_URL = reverse('car:rate-list')
class PublicRateApiTests(TestCase):
"""Test the publicly ... | 26.25 | 70 | 0.653175 | from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Rate
from car.tests.test_cars_api import sample_car
RATE_URL = reverse('car:rate-list')
class PublicRateApiTests(TestCase):
"""Test the publicly ... | 29 | 0 | 27 |
d5764c60efbd4add5da535027a06d13885acb249 | 8,734 | py | Python | anvil/project.py | suraj-testing2/Crab_Floppy_Disk | 01f6f89426308904cc5eaf9f7ab64038f84ea191 | [
"ECL-2.0",
"Apache-2.0"
] | 27 | 2015-02-18T22:38:05.000Z | 2021-05-09T15:17:05.000Z | anvil/project.py | suraj-testing2/Crab_Floppy_Disk | 01f6f89426308904cc5eaf9f7ab64038f84ea191 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2015-05-17T22:42:13.000Z | 2017-05-01T18:31:48.000Z | anvil/project.py | suraj-testing2/Crab_Floppy_Disk | 01f6f89426308904cc5eaf9f7ab64038f84ea191 | [
"ECL-2.0",
"Apache-2.0"
] | 16 | 2015-05-06T20:28:06.000Z | 2021-10-13T22:27:21.000Z | # Copyright 2012 Google Inc. All Rights Reserved.
"""Project representation.
A project is a module (or set of modules) that provides a namespace of rules.
Rules may refer to each other and will be resolved in the project namespace.
"""
__author__ = 'benvanik@google.com (Ben Vanik)'
import base64
import os
import p... | 31.192857 | 80 | 0.691207 | # Copyright 2012 Google Inc. All Rights Reserved.
"""Project representation.
A project is a module (or set of modules) that provides a namespace of rules.
Rules may refer to each other and will be resolved in the project namespace.
"""
__author__ = 'benvanik@google.com (Ben Vanik)'
import base64
import os
import p... | 1,108 | 0 | 100 |
2946e49d29c57fea07784d1b3df3e784a84f0b25 | 12,553 | py | Python | src/cheat_sheet.py | devnll/cursorless-talon | e84caa2548e5b4810ebedc401493da2d9777f82c | [
"MIT"
] | null | null | null | src/cheat_sheet.py | devnll/cursorless-talon | e84caa2548e5b4810ebedc401493da2d9777f82c | [
"MIT"
] | null | null | null | src/cheat_sheet.py | devnll/cursorless-talon | e84caa2548e5b4810ebedc401493da2d9777f82c | [
"MIT"
] | null | null | null | from talon import Module, ui, registry, skia, actions, cron
from talon.canvas import Canvas
import re
import webbrowser
import math
mod = Module()
mod.mode("cursorless_cheat_sheet", "Mode for showing cursorless cheat sheet gui")
cheat_sheet = None
instructions_url = "https://github.com/pokey/cursorless-talon/tree/mas... | 31.071782 | 86 | 0.582092 | from talon import Module, ui, registry, skia, actions, cron
from talon.canvas import Canvas
import re
import webbrowser
import math
mod = Module()
mod.mode("cursorless_cheat_sheet", "Mode for showing cursorless cheat sheet gui")
cheat_sheet = None
instructions_url = "https://github.com/pokey/cursorless-talon/tree/mas... | 10,548 | 508 | 760 |
93718df43e20c5cc7da8bcf1a00e1eb886f84df0 | 10,304 | py | Python | service/doc_main.py | wisebobo/doc_ocr_by_template | 299601c9c5275cf6ad1bbdca071060df5ede0c7b | [
"MIT"
] | 6 | 2019-11-29T10:10:58.000Z | 2022-01-29T07:01:48.000Z | service/doc_main.py | wisebobo/doc_ocr_by_template | 299601c9c5275cf6ad1bbdca071060df5ede0c7b | [
"MIT"
] | 7 | 2019-12-17T05:14:17.000Z | 2022-02-10T01:08:50.000Z | service/doc_main.py | wisebobo/doc_ocr_by_template | 299601c9c5275cf6ad1bbdca071060df5ede0c7b | [
"MIT"
] | 3 | 2019-12-17T09:44:28.000Z | 2022-01-12T09:54:00.000Z | # -*- coding:utf-8 -*-
import logging
from multiprocessing import Pool
from operator import itemgetter
from collections import OrderedDict
from service.doc_etl import doc_etl
from service.api.tencent_ai import tencent_ai
from service.api.baidu_ai import baidu_ai
from service.api.jd_ai import jd_ai
from service.api.face... | 40.566929 | 193 | 0.533967 | # -*- coding:utf-8 -*-
import logging
from multiprocessing import Pool
from operator import itemgetter
from collections import OrderedDict
from service.doc_etl import doc_etl
from service.api.tencent_ai import tencent_ai
from service.api.baidu_ai import baidu_ai
from service.api.jd_ai import jd_ai
from service.api.face... | 9,575 | 2 | 158 |
8285e929480216de19cb0e5711f62bf7eb05a908 | 576 | py | Python | screen_recorder.py | Adarsh232001/Basic-python-scripts | 0fa559087ec3c5e1eec737ea029882b2edaffe1a | [
"MIT"
] | 1 | 2021-09-09T11:13:47.000Z | 2021-09-09T11:13:47.000Z | screen_recorder.py | Adarsh232001/Basic-python-scripts | 0fa559087ec3c5e1eec737ea029882b2edaffe1a | [
"MIT"
] | null | null | null | screen_recorder.py | Adarsh232001/Basic-python-scripts | 0fa559087ec3c5e1eec737ea029882b2edaffe1a | [
"MIT"
] | null | null | null | from PIL import ImageGrab
import numpy as np
import cv2
from win32api import GetSystemMetrics
width = GetSystemMetrics(0)
height = GetSystemMetrics(1)
forcecc = cv2.VideoWriter_fourcc('m','p','4','v')
captured_video = cv2.VideoWriter('output.mp4', forcecc, 20.0, (width, height))
while True:
img = ImageG... | 33.882353 | 79 | 0.690972 | from PIL import ImageGrab
import numpy as np
import cv2
from win32api import GetSystemMetrics
width = GetSystemMetrics(0)
height = GetSystemMetrics(1)
forcecc = cv2.VideoWriter_fourcc('m','p','4','v')
captured_video = cv2.VideoWriter('output.mp4', forcecc, 20.0, (width, height))
while True:
img = ImageG... | 0 | 0 | 0 |
9731dd1457d015a568b3204de73cbf249d4ed962 | 1,051 | py | Python | home/Mastablasta/memo/startmemo.py | rv8flyboy/pyrobotlab | 4e04fb751614a5cb6044ea15dcfcf885db8be65a | [
"Apache-2.0"
] | 63 | 2015-02-03T18:49:43.000Z | 2022-03-29T03:52:24.000Z | home/Mastablasta/memo/startmemo.py | hirwaHenryChristian/pyrobotlab | 2debb381fc2db4be1e7ea6e5252a50ae0de6f4a9 | [
"Apache-2.0"
] | 16 | 2016-01-26T19:13:29.000Z | 2018-11-25T21:20:51.000Z | home/Mastablasta/memo/startmemo.py | hirwaHenryChristian/pyrobotlab | 2debb381fc2db4be1e7ea6e5252a50ae0de6f4a9 | [
"Apache-2.0"
] | 151 | 2015-01-03T18:55:54.000Z | 2022-03-04T07:04:23.000Z | import random
from java.lang import String
from org.myrobotlab.net import BareBonesBrowserLaunch
holygrail = Runtime.createAndStart("holygrail", "WebGui")
wksr = Runtime.createAndStart("webkitspeechrecognition", "WebkitSpeechRecognition")
alice2 = Runtime.createAndStart("alice2", "ProgramAB")
alice2.startSession("C:/mr... | 27.657895 | 83 | 0.717412 | import random
from java.lang import String
from org.myrobotlab.net import BareBonesBrowserLaunch
holygrail = Runtime.createAndStart("holygrail", "WebGui")
wksr = Runtime.createAndStart("webkitspeechrecognition", "WebkitSpeechRecognition")
alice2 = Runtime.createAndStart("alice2", "ProgramAB")
alice2.startSession("C:/mr... | 341 | 0 | 92 |
1c008d0cd0ffa1cb210c4dca87ce41ce81547b15 | 3,340 | py | Python | learning_to_simulate/render_rollout.py | mitchchristow/deepmind-research | 49c7ebe6acc48dd276ca09eca6924ba6cb5ec3a3 | [
"Apache-2.0"
] | 10,110 | 2019-08-27T20:05:30.000Z | 2022-03-31T16:31:56.000Z | learning_to_simulate/render_rollout.py | ibex-training/deepmind-research | 6f8ae40b2626b30f5f80dfc92f5676689eff5599 | [
"Apache-2.0"
] | 317 | 2019-11-09T10:19:10.000Z | 2022-03-31T00:05:19.000Z | learning_to_simulate/render_rollout.py | ibex-training/deepmind-research | 6f8ae40b2626b30f5f80dfc92f5676689eff5599 | [
"Apache-2.0"
] | 2,170 | 2019-08-28T12:53:36.000Z | 2022-03-31T13:15:11.000Z | # Lint as: python3
# pylint: disable=g-bad-file-header
# Copyright 2020 DeepMind Technologies Limited. 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.a... | 32.115385 | 95 | 0.68024 | # Lint as: python3
# pylint: disable=g-bad-file-header
# Copyright 2020 DeepMind Technologies Limited. 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.a... | 1,559 | 0 | 23 |
2d5e8ede167d734734be2e1f3d345a788b768903 | 1,561 | py | Python | ckan/model/package_extra.py | iamarnavgarg/ckan | 59006ac45e0f2df48e22fe15e7a35a5f6b67a5d1 | [
"Apache-2.0"
] | 1 | 2019-11-16T05:13:21.000Z | 2019-11-16T05:13:21.000Z | ckan/model/package_extra.py | iamarnavgarg/ckan | 59006ac45e0f2df48e22fe15e7a35a5f6b67a5d1 | [
"Apache-2.0"
] | null | null | null | ckan/model/package_extra.py | iamarnavgarg/ckan | 59006ac45e0f2df48e22fe15e7a35a5f6b67a5d1 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
from six import text_type
from sqlalchemy import orm, types, Column, Table, ForeignKey
from sqlalchemy.ext.associationproxy import association_proxy
import meta
import core
import package as _package
import extension
import domain_object
import types as _types
import ckan.lib.dictization
import acti... | 28.907407 | 81 | 0.730301 | # encoding: utf-8
from six import text_type
from sqlalchemy import orm, types, Column, Table, ForeignKey
from sqlalchemy.ext.associationproxy import association_proxy
import meta
import core
import package as _package
import extension
import domain_object
import types as _types
import ckan.lib.dictization
import acti... | 102 | 69 | 73 |
3f8bb0128cade4024c2cf69507bf0199fcbe513f | 2,520 | py | Python | UnityPy/classes/AudioClip.py | yvsdrop/UnityPy | af02fbd73eb7fecfae067573b14f8b8e2ed2d17f | [
"MIT"
] | 313 | 2019-11-06T02:47:08.000Z | 2022-03-30T19:29:15.000Z | UnityPy/classes/AudioClip.py | yvsdrop/UnityPy | af02fbd73eb7fecfae067573b14f8b8e2ed2d17f | [
"MIT"
] | 81 | 2019-11-29T02:09:09.000Z | 2022-03-30T19:50:11.000Z | UnityPy/classes/AudioClip.py | yvsdrop/UnityPy | af02fbd73eb7fecfae067573b14f8b8e2ed2d17f | [
"MIT"
] | 81 | 2020-01-12T18:05:25.000Z | 2022-03-22T09:39:15.000Z | from .NamedObject import NamedObject
from ..enums import AudioType, AudioCompressionFormat, AUDIO_TYPE_EXTEMSION
from ..export import AudioClipConverter
from ..helpers.ResourceReader import get_resource_data
| 41.311475 | 100 | 0.611111 | from .NamedObject import NamedObject
from ..enums import AudioType, AudioCompressionFormat, AUDIO_TYPE_EXTEMSION
from ..export import AudioClipConverter
from ..helpers.ResourceReader import get_resource_data
class AudioClip(NamedObject):
def __init__(self, reader):
super().__init__(reader=reader)
... | 2,168 | 120 | 23 |
b7bea0aab3edcea932972d41a250448cc957b36d | 2,026 | py | Python | tests/test_core_lib_basics.py | shubham-surya/core-lib | 543db80706746a937e5ed16bd50f2de8d58b32e4 | [
"MIT"
] | null | null | null | tests/test_core_lib_basics.py | shubham-surya/core-lib | 543db80706746a937e5ed16bd50f2de8d58b32e4 | [
"MIT"
] | 9 | 2021-03-11T02:29:17.000Z | 2022-03-22T19:01:18.000Z | tests/test_core_lib_basics.py | shubham-surya/core-lib | 543db80706746a937e5ed16bd50f2de8d58b32e4 | [
"MIT"
] | 2 | 2022-01-27T11:19:00.000Z | 2022-02-11T11:33:09.000Z | import unittest
from core_lib.core_lib import CoreLib
from core_lib.data_layers.data_access.data_access import DataAccess
from core_lib.core_lib_listener import CoreLibListener
from core_lib.data_layers.service.service import Service
| 30.238806 | 74 | 0.748272 | import unittest
from core_lib.core_lib import CoreLib
from core_lib.data_layers.data_access.data_access import DataAccess
from core_lib.core_lib_listener import CoreLibListener
from core_lib.data_layers.service.service import Service
class EventsDataAccess(DataAccess, CoreLibListener):
def __init__(self):
... | 1,321 | 239 | 227 |
6a14ff455c5e51b66497423f74c90f56e9a11e5d | 12,704 | py | Python | src/rubrix/server/tasks/text_classification/api/model.py | king1rule/rubrix | 123b34f5aa0dbf55e7a91e696c2ac4f6460ea574 | [
"Apache-2.0"
] | null | null | null | src/rubrix/server/tasks/text_classification/api/model.py | king1rule/rubrix | 123b34f5aa0dbf55e7a91e696c2ac4f6460ea574 | [
"Apache-2.0"
] | null | null | null | src/rubrix/server/tasks/text_classification/api/model.py | king1rule/rubrix | 123b34f5aa0dbf55e7a91e696c2ac4f6460ea574 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021-present, the Recognai S.L. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 28.484305 | 88 | 0.644836 | # coding=utf-8
# Copyright 2021-present, the Recognai S.L. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 1,130 | 152 | 237 |
4a4f5f11bf136a40b406c56e6f05ada2adfb49be | 27 | py | Python | tfwstartr/__init__.py | avatao-content/tfw-startr | fc7086ab1f44434ea76e0d96c9bfb13367a08460 | [
"Apache-2.0"
] | null | null | null | tfwstartr/__init__.py | avatao-content/tfw-startr | fc7086ab1f44434ea76e0d96c9bfb13367a08460 | [
"Apache-2.0"
] | null | null | null | tfwstartr/__init__.py | avatao-content/tfw-startr | fc7086ab1f44434ea76e0d96c9bfb13367a08460 | [
"Apache-2.0"
] | null | null | null | from .startr import Startr
| 13.5 | 26 | 0.814815 | from .startr import Startr
| 0 | 0 | 0 |
c5a187cdc2d6f528792233c3bb896cbd35087b22 | 3,643 | py | Python | paderbox/io/json_module.py | JanekEbb/paderbox | 7cd3bf92380e05ec856936d21a64d0a8a3ff0fca | [
"MIT"
] | 25 | 2019-12-21T21:10:08.000Z | 2022-02-04T10:40:19.000Z | paderbox/io/json_module.py | JanekEbb/paderbox | 7cd3bf92380e05ec856936d21a64d0a8a3ff0fca | [
"MIT"
] | 32 | 2019-12-21T21:48:24.000Z | 2022-03-31T08:20:39.000Z | paderbox/io/json_module.py | JanekEbb/paderbox | 7cd3bf92380e05ec856936d21a64d0a8a3ff0fca | [
"MIT"
] | 254 | 2019-12-16T08:15:08.000Z | 2021-11-26T12:41:12.000Z |
import io
import numpy as np
import json
import datetime
from pathlib import Path
# http://stackoverflow.com/a/27050186
class SummaryEncoder(Encoder):
"""
Often, you may want a very short summary, just containing some shapes of
numpy arrays in a Jupyter Notebook.
Example usage:
>>> import nump... | 28.912698 | 106 | 0.59978 |
import io
import numpy as np
import json
import datetime
from pathlib import Path
# http://stackoverflow.com/a/27050186
class Encoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.integer):
return int(obj)
elif isinstance(obj, np.floating):
return float(... | 1,124 | 11 | 98 |
965ea6a7ee8b2f87818e011ac212e8d1c45bf216 | 2,252 | py | Python | lib/mplcairo/qt.py | QuLogic/mplcairo | b5ff0ba6beb18a30419310750e7fba6edbe9c267 | [
"MIT"
] | null | null | null | lib/mplcairo/qt.py | QuLogic/mplcairo | b5ff0ba6beb18a30419310750e7fba6edbe9c267 | [
"MIT"
] | null | null | null | lib/mplcairo/qt.py | QuLogic/mplcairo | b5ff0ba6beb18a30419310750e7fba6edbe9c267 | [
"MIT"
] | null | null | null | import ctypes
from matplotlib.backends.backend_qt5 import _BackendQT5, FigureCanvasQT
from matplotlib.backends.qt_compat import QtGui
from . import _util
from .base import FigureCanvasCairo
@_BackendQT5.export
| 39.508772 | 79 | 0.662522 | import ctypes
from matplotlib.backends.backend_qt5 import _BackendQT5, FigureCanvasQT
from matplotlib.backends.qt_compat import QtGui
from . import _util
from .base import FigureCanvasCairo
class FigureCanvasQTCairo(FigureCanvasCairo, FigureCanvasQT):
def paintEvent(self, event):
if hasattr(self, "_upda... | 1,845 | 94 | 98 |
ed8f21a09d541f1f17af6da6dfe1fc743d860525 | 23,761 | py | Python | src/pyrad_proc/pyrad/graph/plots_timeseries.py | jfigui/pyrad | 7811d593bb09a7f8a621c0e8ae3f32c2b85a0254 | [
"BSD-3-Clause"
] | 41 | 2016-12-01T08:46:06.000Z | 2021-06-24T21:14:33.000Z | src/pyrad_proc/pyrad/graph/plots_timeseries.py | jfigui/pyrad | 7811d593bb09a7f8a621c0e8ae3f32c2b85a0254 | [
"BSD-3-Clause"
] | 42 | 2017-02-23T14:52:49.000Z | 2021-02-01T10:43:52.000Z | src/pyrad_proc/pyrad/graph/plots_timeseries.py | jfigui/pyrad | 7811d593bb09a7f8a621c0e8ae3f32c2b85a0254 | [
"BSD-3-Clause"
] | 21 | 2016-08-25T15:02:12.000Z | 2021-05-27T04:09:40.000Z | """
pyrad.graph.plot_timeseries
===========================
Functions to plot Pyrad datasets
.. autosummary::
:toctree: generated/
plot_timeseries
plot_timeseries_comp
plot_monitoring_ts
plot_intercomp_scores_ts
plot_ml_ts
plot_sun_retrieval_ts
"""
from warnings import warn
import nump... | 31.060131 | 78 | 0.610665 | """
pyrad.graph.plot_timeseries
===========================
Functions to plot Pyrad datasets
.. autosummary::
:toctree: generated/
plot_timeseries
plot_timeseries_comp
plot_monitoring_ts
plot_intercomp_scores_ts
plot_ml_ts
plot_sun_retrieval_ts
"""
from warnings import warn
import nump... | 0 | 0 | 0 |
1ce4bff6959044eed3aa41259057c196a313c77b | 5,126 | py | Python | GPy/kern/_src/coregionalize.py | beckdaniel/GPy | 37e835aa36b18c32bc500684cc10dd2b74240e1f | [
"BSD-3-Clause"
] | null | null | null | GPy/kern/_src/coregionalize.py | beckdaniel/GPy | 37e835aa36b18c32bc500684cc10dd2b74240e1f | [
"BSD-3-Clause"
] | null | null | null | GPy/kern/_src/coregionalize.py | beckdaniel/GPy | 37e835aa36b18c32bc500684cc10dd2b74240e1f | [
"BSD-3-Clause"
] | 1 | 2020-02-21T02:40:18.000Z | 2020-02-21T02:40:18.000Z | # Copyright (c) 2012, James Hensman and Ricardo Andrade
# Licensed under the BSD 3-clause license (see LICENSE.txt)
from .kern import Kern
import numpy as np
from ...core.parameterization import Param
from ...core.parameterization.transformations import Logexp
from ...util.config import config # for assesing whether t... | 38.541353 | 155 | 0.643582 | # Copyright (c) 2012, James Hensman and Ricardo Andrade
# Licensed under the BSD 3-clause license (see LICENSE.txt)
from .kern import Kern
import numpy as np
from ...core.parameterization import Param
from ...core.parameterization.transformations import Logexp
from ...util.config import config # for assesing whether t... | 3,205 | 0 | 323 |
13647ffc9e3bd7517d74d7bec885a1f5f15f8773 | 3,591 | py | Python | main-VG.py | HocRiser01/GEV-NN | a500106a33b75e78fa82b79ac2364668a3e35786 | [
"MIT"
] | null | null | null | main-VG.py | HocRiser01/GEV-NN | a500106a33b75e78fa82b79ac2364668a3e35786 | [
"MIT"
] | null | null | null | main-VG.py | HocRiser01/GEV-NN | a500106a33b75e78fa82b79ac2364668a3e35786 | [
"MIT"
] | null | null | null | import os
import numpy as np
import pandas as pd
import torch
from torch import nn
from torch import optim
from torch.utils import data
import matplotlib
import matplotlib.pyplot as plt
import GEV
import display
from config import config
import selection
from train import train
from construct import construct
from skle... | 33.877358 | 93 | 0.683932 | import os
import numpy as np
import pandas as pd
import torch
from torch import nn
from torch import optim
from torch.utils import data
import matplotlib
import matplotlib.pyplot as plt
import GEV
import display
from config import config
import selection
from train import train
from construct import construct
from skle... | 924 | 10 | 97 |
742784c7e5819d752826b636c3ac8ea2f23a2f9e | 3,318 | py | Python | amp_build.py | AudiovisualMetadataPlatform/amp_mgms | 593d4f4d40b597a7753cd152cd233976e6b28c75 | [
"Apache-2.0"
] | null | null | null | amp_build.py | AudiovisualMetadataPlatform/amp_mgms | 593d4f4d40b597a7753cd152cd233976e6b28c75 | [
"Apache-2.0"
] | 1 | 2022-02-16T16:21:03.000Z | 2022-02-16T16:21:03.000Z | amp_build.py | AudiovisualMetadataPlatform/amp_mgms | 593d4f4d40b597a7753cd152cd233976e6b28c75 | [
"Apache-2.0"
] | null | null | null | #!/bin/env python3
#
# Build the amp-mgms tarball for distribution
#
import argparse
import logging
import tempfile
from pathlib import Path
import shutil
import sys
import yaml
from datetime import datetime
import os
import subprocess
from amp_bootstrap_utils import run_cmd, build_package
if __name__ == "... | 39.975904 | 118 | 0.644665 | #!/bin/env python3
#
# Build the amp-mgms tarball for distribution
#
import argparse
import logging
import tempfile
from pathlib import Path
import shutil
import sys
import yaml
from datetime import datetime
import os
import subprocess
from amp_bootstrap_utils import run_cmd, build_package
def main():
parser = ar... | 2,953 | 0 | 23 |
96d34719ef0770d0dc719cc1292e68093ca10fc8 | 2,486 | py | Python | server/CVFL_flask_streaming/camera_opencv.py | adeept/adeept_alter | 6adf00eb141405fc3abad44965f81ba7797dd962 | [
"MIT"
] | 1 | 2021-12-21T15:50:57.000Z | 2021-12-21T15:50:57.000Z | server/CVFL_flask_streaming/camera_opencv.py | adeept/adeept_alter | 6adf00eb141405fc3abad44965f81ba7797dd962 | [
"MIT"
] | 2 | 2021-03-14T22:05:42.000Z | 2021-07-19T22:13:37.000Z | server/CVFL_flask_streaming/camera_opencv.py | adeept/adeept_alter | 6adf00eb141405fc3abad44965f81ba7797dd962 | [
"MIT"
] | null | null | null | import os
import cv2
from base_camera import BaseCamera
import numpy as np
import time
import threading
import imutils
'''
Set the color of the line, 255 is white line, 0 is black line
'''
lineColorSet = 255
'''
Set the reference horizontal position, the larger the value, the lower,
but it cannot be greater than the ... | 32.285714 | 130 | 0.705953 | import os
import cv2
from base_camera import BaseCamera
import numpy as np
import time
import threading
import imutils
'''
Set the color of the line, 255 is white line, 0 is black line
'''
lineColorSet = 255
'''
Set the reference horizontal position, the larger the value, the lower,
but it cannot be greater than the ... | 1,958 | 123 | 23 |
62b3e7773e3203f6f2a28718fd101a02a1022969 | 1,210 | py | Python | Sports/NBA.py | fefelson/FelsonSports | bc0c16d63b19ffe4d468dcda5ab224013abe23fa | [
"MIT"
] | null | null | null | Sports/NBA.py | fefelson/FelsonSports | bc0c16d63b19ffe4d468dcda5ab224013abe23fa | [
"MIT"
] | null | null | null | Sports/NBA.py | fefelson/FelsonSports | bc0c16d63b19ffe4d468dcda5ab224013abe23fa | [
"MIT"
] | null | null | null | from ..DB import NBADB
from ..Models import (DailyBoxScore, DailyFileManager, DailyMatchup, DailySchedule,
NBAPlayer, League, NBAReport)
################################################################################
##########################################################################... | 28.139535 | 83 | 0.402479 | from ..DB import NBADB
from ..Models import (DailyBoxScore, DailyFileManager, DailyMatchup, DailySchedule,
NBAPlayer, League, NBAReport)
################################################################################
##########################################################################... | 90 | 583 | 23 |
040fca9fddb067b14c56ab2bdecc86a33a521637 | 4,742 | py | Python | edlm/convert/_make_pdf.py | etcher-be/EDLM | 7b25c85252fd15c2c222b00271f7a32e335db704 | [
"MIT"
] | null | null | null | edlm/convert/_make_pdf.py | etcher-be/EDLM | 7b25c85252fd15c2c222b00271f7a32e335db704 | [
"MIT"
] | 4 | 2020-03-24T16:53:26.000Z | 2020-06-26T08:31:13.000Z | edlm/convert/_make_pdf.py | etcher-be/EDLM | 7b25c85252fd15c2c222b00271f7a32e335db704 | [
"MIT"
] | null | null | null | # coding=utf-8
"""
Makes a PDF document from a source folder
"""
import shutil
import urllib.parse
from pathlib import Path
import elib
from edlm import LOGGER
from edlm.convert import Context
from edlm.external_tools import PANDOC
from ._check_for_unused_images import check_for_unused_images
from ._get_includes im... | 27.894118 | 95 | 0.619992 | # coding=utf-8
"""
Makes a PDF document from a source folder
"""
import shutil
import urllib.parse
from pathlib import Path
import elib
from edlm import LOGGER
from edlm.convert import Context
from edlm.external_tools import PANDOC
from ._check_for_unused_images import check_for_unused_images
from ._get_includes im... | 2,990 | 0 | 115 |
30de931e7a17711ef72c79dc51935268bcb9af5a | 12,652 | py | Python | main.py | Harsh-0986/NoteWord | 492b7a17a18eeeaf05c912bacdeb4e9c6c461391 | [
"MIT"
] | 1 | 2021-04-29T09:18:26.000Z | 2021-04-29T09:18:26.000Z | main.py | Harsh-0986/NoteWord | 492b7a17a18eeeaf05c912bacdeb4e9c6c461391 | [
"MIT"
] | null | null | null | main.py | Harsh-0986/NoteWord | 492b7a17a18eeeaf05c912bacdeb4e9c6c461391 | [
"MIT"
] | null | null | null | import sys
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtPrintSupport import *
import urllib.request
class MainApp(QMainWindow):
""" the main class of our app """
def __init__(self):
""" init things here """
super().__init__() ... | 34.663014 | 151 | 0.62662 | import sys
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtPrintSupport import *
import urllib.request
class MainApp(QMainWindow):
""" the main class of our app """
def __init__(self):
""" init things here """
super().__init__() ... | 11,345 | 0 | 324 |
3d4ad1e746ec78e19316f6e016ac3f30a9158745 | 932 | py | Python | main.py | w0xter/virtuarrrml | 3e1616cf9179cb7009f048cf8914813e29cf382f | [
"Apache-2.0"
] | null | null | null | main.py | w0xter/virtuarrrml | 3e1616cf9179cb7009f048cf8914813e29cf382f | [
"Apache-2.0"
] | null | null | null | main.py | w0xter/virtuarrrml | 3e1616cf9179cb7009f048cf8914813e29cf382f | [
"Apache-2.0"
] | null | null | null | from YarrrmlUtils import Yarrrml
from SparqlUtils import Sparql
from SqlUtils import Sql
import json
import sys
dataset = "./test/gtfs/"
queryDir = "query2/"
if __name__ == '__main__':
main() | 37.28 | 96 | 0.733906 | from YarrrmlUtils import Yarrrml
from SparqlUtils import Sparql
from SqlUtils import Sql
import json
import sys
dataset = "./test/gtfs/"
queryDir = "query2/"
def main():
query = Sparql( dataset + queryDir + 'query.rq')
mapping = Yarrrml(dataset + 'mapping.yaml')
writeResult(dataset + queryDir + "queryUris... | 691 | 0 | 45 |
2b5558f42369a7e2a14152b11ac1fcf3d075b5f2 | 59 | py | Python | django_rdkit/__init__.py | rustamzh/django-rdkit | 34e61a00f5f47a9f2d2f064c4a77aae46f8cd36f | [
"BSD-3-Clause"
] | 35 | 2015-07-30T13:35:37.000Z | 2021-12-17T01:00:26.000Z | django_rdkit/__init__.py | rvianello/django-rdkit | 9bbbebb45b8af15006e1e2ffec7744705de2a295 | [
"BSD-3-Clause"
] | 21 | 2016-03-10T16:06:03.000Z | 2022-01-20T14:11:46.000Z | django_rdkit/__init__.py | rvianello/django-rdkit | 9bbbebb45b8af15006e1e2ffec7744705de2a295 | [
"BSD-3-Clause"
] | 24 | 2015-07-11T22:10:27.000Z | 2021-12-10T20:55:19.000Z | default_app_config = 'django_rdkit.apps.DjangoRDKitConfig'
| 29.5 | 58 | 0.864407 | default_app_config = 'django_rdkit.apps.DjangoRDKitConfig'
| 0 | 0 | 0 |
a0a5e311757219c61bd041935ab8a9cab0a76561 | 3,755 | py | Python | project/openaid/projects/serializers.py | DeppSRL/open-aid | 84130761c00600a8523f4f28467d70ad974859cd | [
"BSD-3-Clause"
] | null | null | null | project/openaid/projects/serializers.py | DeppSRL/open-aid | 84130761c00600a8523f4f28467d70ad974859cd | [
"BSD-3-Clause"
] | null | null | null | project/openaid/projects/serializers.py | DeppSRL/open-aid | 84130761c00600a8523f4f28467d70ad974859cd | [
"BSD-3-Clause"
] | null | null | null | from rest_framework import serializers
from ..serializers import TranslatedModelSerializer
from .models import Project, Activity, Markers, ChannelReported
| 53.642857 | 123 | 0.757124 | from rest_framework import serializers
from ..serializers import TranslatedModelSerializer
from .models import Project, Activity, Markers, ChannelReported
class MarkersSerializer(TranslatedModelSerializer):
class Meta:
model = Markers
fields = (
'biodiversity', 'climate_adaptation', '... | 0 | 3,479 | 115 |
cc33b7d598e664e7d4ed4e0e84affa1ce6fd1aa2 | 2,253 | py | Python | solutions/Special-Cryptagram.py | Reyansh14/leetcode-solutions | 288bc2708acb21678b9ab51b0d5a4b326b3f7328 | [
"MIT"
] | null | null | null | solutions/Special-Cryptagram.py | Reyansh14/leetcode-solutions | 288bc2708acb21678b9ab51b0d5a4b326b3f7328 | [
"MIT"
] | null | null | null | solutions/Special-Cryptagram.py | Reyansh14/leetcode-solutions | 288bc2708acb21678b9ab51b0d5a4b326b3f7328 | [
"MIT"
] | null | null | null | # A cryptarithm is a mathematical puzzle for which the goal is to find the correspondence between letters and digits, such that the given arithmetic equation consisting of letters holds true when the letters are converted to digits.
# You have an array of strings crypt, the cryptarithm, and an an array containing the m... | 45.06 | 299 | 0.586773 | # A cryptarithm is a mathematical puzzle for which the goal is to find the correspondence between letters and digits, such that the given arithmetic equation consisting of letters holds true when the letters are converted to digits.
# You have an array of strings crypt, the cryptarithm, and an an array containing the m... | 562 | 0 | 23 |
e3e3912cf70529a8f97477caa320dcbe70a9e178 | 9,196 | py | Python | tests/unit/backend/corpora/dataset_processing/test_process.py | isabella232/corpora-data-portal | 09ed3cad3165f8b0db854b76404e0d5d0ea0b7d9 | [
"MIT"
] | null | null | null | tests/unit/backend/corpora/dataset_processing/test_process.py | isabella232/corpora-data-portal | 09ed3cad3165f8b0db854b76404e0d5d0ea0b7d9 | [
"MIT"
] | 1 | 2021-02-23T22:56:13.000Z | 2021-02-23T22:56:13.000Z | tests/unit/backend/corpora/dataset_processing/test_process.py | isabella232/corpora-data-portal | 09ed3cad3165f8b0db854b76404e0d5d0ea0b7d9 | [
"MIT"
] | null | null | null | import os
import pathlib
import shutil
import tempfile
import unittest
from unittest.mock import patch
import anndata
import boto3
import numpy
import pandas
from moto import mock_s3
from backend.corpora.common.corpora_orm import (
CollectionVisibility,
DatasetArtifactType,
DatasetArtifactFileType,
U... | 39.809524 | 119 | 0.607438 | import os
import pathlib
import shutil
import tempfile
import unittest
from unittest.mock import patch
import anndata
import boto3
import numpy
import pandas
from moto import mock_s3
from backend.corpora.common.corpora_orm import (
CollectionVisibility,
DatasetArtifactType,
DatasetArtifactFileType,
U... | 8,001 | 632 | 23 |
72441f002cfab9213c47e77f02b157d43378f7d4 | 125 | py | Python | tests/utils.py | adalekin/connexion-buzz | c96beebb26ef84858b5131ba2f3c1a0b9152b137 | [
"BSD-3-Clause"
] | null | null | null | tests/utils.py | adalekin/connexion-buzz | c96beebb26ef84858b5131ba2f3c1a0b9152b137 | [
"BSD-3-Clause"
] | null | null | null | tests/utils.py | adalekin/connexion-buzz | c96beebb26ef84858b5131ba2f3c1a0b9152b137 | [
"BSD-3-Clause"
] | null | null | null | import re
def stripped(text):
"""
Removes all whitespace from a string
"""
return re.sub(r'\s+', '', text)
| 13.888889 | 40 | 0.568 | import re
def stripped(text):
"""
Removes all whitespace from a string
"""
return re.sub(r'\s+', '', text)
| 0 | 0 | 0 |
f53ac81b7ecb44832ad31f68483f86e0835e7a72 | 347 | py | Python | commands/__init__.py | UnsignedByte/Coconut-Milk | 04a8f38693cb93fb45a25082e39e6de5544a9195 | [
"MIT"
] | 1 | 2019-10-10T06:08:46.000Z | 2019-10-10T06:08:46.000Z | commands/__init__.py | UnsignedByte/Coconut-Milk | 04a8f38693cb93fb45a25082e39e6de5544a9195 | [
"MIT"
] | null | null | null | commands/__init__.py | UnsignedByte/Coconut-Milk | 04a8f38693cb93fb45a25082e39e6de5544a9195 | [
"MIT"
] | null | null | null | # @Author: Edmund Lam <edl>
# @Date: 18:44:31, 17-Apr-2018
# @Filename: __init__.py
# @Last modified by: edl
# @Last modified time: 10:05:18, 13-Oct-2019
# __all__=['settings', 'utilities', 'fun', 'economy', 'help', 'quiz', 'trivia', 'wolframalpha', 'ascii_art', 'regex_commands']
__all__=['moderation', 'help', 'u... | 34.7 | 126 | 0.657061 | # @Author: Edmund Lam <edl>
# @Date: 18:44:31, 17-Apr-2018
# @Filename: __init__.py
# @Last modified by: edl
# @Last modified time: 10:05:18, 13-Oct-2019
# __all__=['settings', 'utilities', 'fun', 'economy', 'help', 'quiz', 'trivia', 'wolframalpha', 'ascii_art', 'regex_commands']
__all__=['moderation', 'help', 'u... | 0 | 0 | 0 |
9c3e4c63c75f287c5109e38d3e40315dc8b12943 | 1,858 | py | Python | setup.py | 2320sharon/localtileserver | 2ed2f564b50a755e5528021fb200b157a16add8e | [
"MIT"
] | null | null | null | setup.py | 2320sharon/localtileserver | 2ed2f564b50a755e5528021fb200b157a16add8e | [
"MIT"
] | null | null | null | setup.py | 2320sharon/localtileserver | 2ed2f564b50a755e5528021fb200b157a16add8e | [
"MIT"
] | null | null | null | from io import open as io_open
import os
from setuptools import find_packages, setup
dirname = os.path.dirname(__file__)
readme_file = os.path.join(dirname, "README.md")
if os.path.exists(readme_file):
with io_open(readme_file, "r", encoding="utf-8") as f:
long_description = f.read()
else:
# When this... | 29.492063 | 84 | 0.632939 | from io import open as io_open
import os
from setuptools import find_packages, setup
dirname = os.path.dirname(__file__)
readme_file = os.path.join(dirname, "README.md")
if os.path.exists(readme_file):
with io_open(readme_file, "r", encoding="utf-8") as f:
long_description = f.read()
else:
# When this... | 0 | 0 | 0 |
ad512b56f11b247129270d04bb6ea3c769e6ddeb | 272 | py | Python | gforce.py | exegol/raspi_sense | 8a5ce90c049db6d2ebfd6ae32a08c36d1621d98f | [
"MIT"
] | null | null | null | gforce.py | exegol/raspi_sense | 8a5ce90c049db6d2ebfd6ae32a08c36d1621d98f | [
"MIT"
] | null | null | null | gforce.py | exegol/raspi_sense | 8a5ce90c049db6d2ebfd6ae32a08c36d1621d98f | [
"MIT"
] | null | null | null | from sense_hat import SenseHat
sense = SenseHat()
while True:
acceleration = sense.get_accelerometer_raw()
x = acceleration['x']
y = acceleration['y']
z = acceleration['z']
x=round(x, 0)
y=round(y, 0)
z=round(z, 0)
print("x={0}, y={1}, z={2}".format(x, y, z))
| 17 | 45 | 0.636029 | from sense_hat import SenseHat
sense = SenseHat()
while True:
acceleration = sense.get_accelerometer_raw()
x = acceleration['x']
y = acceleration['y']
z = acceleration['z']
x=round(x, 0)
y=round(y, 0)
z=round(z, 0)
print("x={0}, y={1}, z={2}".format(x, y, z))
| 0 | 0 | 0 |
5e139d61a6c0acddfc09bdad0eedcfcf09f0c892 | 199 | py | Python | python/8kyu/is_it_a_number.py | Sigmanificient/codewars | b34df4bf55460d312b7ddf121b46a707b549387a | [
"MIT"
] | 3 | 2021-06-08T01:57:13.000Z | 2021-06-26T10:52:47.000Z | python/8kyu/is_it_a_number.py | Sigmanificient/codewars | b34df4bf55460d312b7ddf121b46a707b549387a | [
"MIT"
] | null | null | null | python/8kyu/is_it_a_number.py | Sigmanificient/codewars | b34df4bf55460d312b7ddf121b46a707b549387a | [
"MIT"
] | 2 | 2021-06-10T21:20:13.000Z | 2021-06-30T10:13:26.000Z | """Kata url: https://www.codewars.com/kata/57126304cdbf63c6770012bd."""
| 18.090909 | 71 | 0.603015 | """Kata url: https://www.codewars.com/kata/57126304cdbf63c6770012bd."""
def is_digit(x: str) -> bool:
try:
_ = float(x)
return True
except ValueError:
return False
| 103 | 0 | 23 |
3861591b861d4193451a0c3e1756de70f4bb3e9c | 355 | py | Python | bench/bench_aioredis_get.py | Gelbpunkt/zangy | abe2575b202c4bab9f33a20a8b6b267d6714a2ce | [
"MIT"
] | 4 | 2020-11-26T06:19:44.000Z | 2021-05-22T07:21:57.000Z | bench/bench_aioredis_get.py | Gelbpunkt/zangy | abe2575b202c4bab9f33a20a8b6b267d6714a2ce | [
"MIT"
] | 1 | 2021-05-12T13:59:06.000Z | 2021-05-12T16:59:00.000Z | bench/bench_aioredis_get.py | Gelbpunkt/zangy | abe2575b202c4bab9f33a20a8b6b267d6714a2ce | [
"MIT"
] | null | null | null | import asyncio
import aioredis
import uvloop
from tqdm.asyncio import tqdm
uvloop.install()
asyncio.run(main())
| 22.1875 | 88 | 0.698592 | import asyncio
import aioredis
import uvloop
from tqdm.asyncio import tqdm
uvloop.install()
async def main():
pool = await aioredis.create_redis_pool("redis://localhost", minsize=10, maxsize=10)
await pool.set("bench", "yes")
async for i in tqdm(range(1000000), desc="Getting keys..."):
await pool.... | 217 | 0 | 23 |
1386248393d70970898e9fecb8a88f08702d75f1 | 656 | py | Python | app/__init__.py | yogishah-9698/docusign | 96eb3e98a5e0cf432a821d02628c8a38ebdecbf8 | [
"MIT"
] | null | null | null | app/__init__.py | yogishah-9698/docusign | 96eb3e98a5e0cf432a821d02628c8a38ebdecbf8 | [
"MIT"
] | null | null | null | app/__init__.py | yogishah-9698/docusign | 96eb3e98a5e0cf432a821d02628c8a38ebdecbf8 | [
"MIT"
] | null | null | null | import os
from app import ds_config
from flask import Flask
from flask_wtf.csrf import CSRFProtect
session_path = "/tmp/python_recipe_sessions"
app = Flask(__name__)
app.config.from_pyfile("config.py")
app.secret_key = ds_config.DS_CONFIG["session_secret"]
csrf = CSRFProtect(app) # See https://flask-wtf.readthedocs.... | 28.521739 | 82 | 0.76372 | import os
from app import ds_config
from flask import Flask
from flask_wtf.csrf import CSRFProtect
session_path = "/tmp/python_recipe_sessions"
app = Flask(__name__)
app.config.from_pyfile("config.py")
app.secret_key = ds_config.DS_CONFIG["session_secret"]
csrf = CSRFProtect(app) # See https://flask-wtf.readthedocs.... | 0 | 0 | 0 |
75bb762489e0e532fb7ce33d7f181053742e378e | 42 | py | Python | commands/data/FOOTER.py | EJ-Studio/EJ-DJ | ed794749216deb47bc93e432fdc7f024473f3236 | [
"Apache-2.0"
] | null | null | null | commands/data/FOOTER.py | EJ-Studio/EJ-DJ | ed794749216deb47bc93e432fdc7f024473f3236 | [
"Apache-2.0"
] | null | null | null | commands/data/FOOTER.py | EJ-Studio/EJ-DJ | ed794749216deb47bc93e432fdc7f024473f3236 | [
"Apache-2.0"
] | null | null | null | footer = "By: EJ Studios for>> EJ Studios" | 42 | 42 | 0.690476 | footer = "By: EJ Studios for>> EJ Studios" | 0 | 0 | 0 |
09abaeccabc2bf38e667a62e0749a35e9bc0f5c7 | 14,977 | py | Python | app/controllers/employment.py | MTES-MCT/mobilic-api | b3754de2282262fd60a27dc90e40777df9c1e230 | [
"MIT"
] | null | null | null | app/controllers/employment.py | MTES-MCT/mobilic-api | b3754de2282262fd60a27dc90e40777df9c1e230 | [
"MIT"
] | 8 | 2021-04-19T17:47:55.000Z | 2022-02-16T17:40:18.000Z | app/controllers/employment.py | MTES-MCT/mobilic-api | b3754de2282262fd60a27dc90e40777df9c1e230 | [
"MIT"
] | null | null | null | from flask import after_this_request
from app.domain.permissions import company_admin
from app.helpers.authentication import (
current_user,
set_auth_cookies,
create_access_tokens_for,
AuthenticatedMutation,
require_auth_with_write_access,
)
import graphene
from datetime import datetime, date, time... | 31.663848 | 251 | 0.611872 | from flask import after_this_request
from app.domain.permissions import company_admin
from app.helpers.authentication import (
current_user,
set_auth_cookies,
create_access_tokens_for,
AuthenticatedMutation,
require_auth_with_write_access,
)
import graphene
from datetime import datetime, date, time... | 7,663 | 3,555 | 433 |
8543ad77ad5aa96fdc888a4f35614fd907646e54 | 657 | py | Python | tests/renderers/number/conftest.py | timvink/pheasant | eb5b0a8b5473baad5ad4903984433fe763f5312e | [
"MIT"
] | 24 | 2018-05-25T15:23:30.000Z | 2021-06-09T10:56:52.000Z | tests/renderers/number/conftest.py | timvink/pheasant | eb5b0a8b5473baad5ad4903984433fe763f5312e | [
"MIT"
] | 14 | 2019-04-30T10:51:01.000Z | 2020-09-16T20:37:30.000Z | tests/renderers/number/conftest.py | timvink/pheasant | eb5b0a8b5473baad5ad4903984433fe763f5312e | [
"MIT"
] | 9 | 2019-06-12T10:54:18.000Z | 2022-01-15T21:19:05.000Z | import pytest
from pheasant.renderers.number.number import Anchor, Header
@pytest.fixture(scope="module")
@pytest.fixture(scope="module")
@pytest.fixture()
| 19.909091 | 59 | 0.520548 | import pytest
from pheasant.renderers.number.number import Anchor, Header
@pytest.fixture(scope="module")
def header():
header = Header(config={"__dummy__": "test"})
return header
@pytest.fixture(scope="module")
def anchor():
anchor = Anchor()
return anchor
@pytest.fixture()
def source_simple():
... | 428 | 0 | 66 |
f1129840e4cece0af36fad5a0478299b416c6cd3 | 5,091 | py | Python | gmodetector_py/weight_array.py | naglemi/gmodetector_py | d8d638a0a09f2031a6136fc8eacd7062bfc7ec64 | [
"BSD-3-Clause"
] | null | null | null | gmodetector_py/weight_array.py | naglemi/gmodetector_py | d8d638a0a09f2031a6136fc8eacd7062bfc7ec64 | [
"BSD-3-Clause"
] | null | null | null | gmodetector_py/weight_array.py | naglemi/gmodetector_py | d8d638a0a09f2031a6136fc8eacd7062bfc7ec64 | [
"BSD-3-Clause"
] | null | null | null | from gmodetector_py import regress
from gmodetector_py import find_desired_channel
from gmodetector_py import slice_desired_channel
from gmodetector_py import CLS_to_image
import h5py
import numpy as np
import pandas as pd
import os
class WeightArray:
"""A 3D array containing weights for each spectral component, ... | 51.94898 | 234 | 0.64781 | from gmodetector_py import regress
from gmodetector_py import find_desired_channel
from gmodetector_py import slice_desired_channel
from gmodetector_py import CLS_to_image
import h5py
import numpy as np
import pandas as pd
import os
class WeightArray:
"""A 3D array containing weights for each spectral component, ... | 2,732 | 0 | 108 |
c2d381d9abbc4843fbc9f5743dd6c0f7c8426838 | 14,533 | py | Python | zbackup/common.py | sandromello/zbackup | 86e1211363968fbee49abf9a430c2b201186b4ea | [
"Apache-2.0"
] | 6 | 2017-01-28T18:40:39.000Z | 2021-07-08T09:47:48.000Z | zbackup/common.py | sandromello/zbackup | 86e1211363968fbee49abf9a430c2b201186b4ea | [
"Apache-2.0"
] | 4 | 2015-07-02T22:52:11.000Z | 2017-10-23T02:20:19.000Z | zbackup/common.py | sandromello/zbackup | 86e1211363968fbee49abf9a430c2b201186b4ea | [
"Apache-2.0"
] | 5 | 2016-09-16T00:38:32.000Z | 2019-06-12T08:48:45.000Z | #!/usr/bin/python
import ldap, logging, shelve
import subprocess as sb
import xml.etree.ElementTree as ET
import os, time, sys, urllib2, ConfigParser, pwd
from datetime import datetime, timedelta
from base64 import b64encode
CONFIG_FILE_INI = '/opt/zimbra/conf/zbackup.ini'
ZIMBRA_ACCOUNT_STATUS = ['active', 'locked', ... | 35.533007 | 121 | 0.654923 | #!/usr/bin/python
import ldap, logging, shelve
import subprocess as sb
import xml.etree.ElementTree as ET
import os, time, sys, urllib2, ConfigParser, pwd
from datetime import datetime, timedelta
from base64 import b64encode
CONFIG_FILE_INI = '/opt/zimbra/conf/zbackup.ini'
ZIMBRA_ACCOUNT_STATUS = ['active', 'locked', ... | 11,622 | 1,911 | 309 |
2ea7dee219622fcf515f2738fb83bcddcbb73f60 | 1,884 | py | Python | test/preprocessing_test.py | losedavidpb/kata_ialib | 8c7677be0fb6394d4a77402d65fb3485900f336f | [
"MIT"
] | 1 | 2021-11-08T10:07:39.000Z | 2021-11-08T10:07:39.000Z | test/preprocessing_test.py | losedavidpb/kata_ialib | 8c7677be0fb6394d4a77402d65fb3485900f336f | [
"MIT"
] | null | null | null | test/preprocessing_test.py | losedavidpb/kata_ialib | 8c7677be0fb6394d4a77402d65fb3485900f336f | [
"MIT"
] | null | null | null | import unittest
import numpy as np
from preprocessing import split_data, principal_components
if __name__ == '__main__':
unittest.main()
| 36.230769 | 90 | 0.649682 | import unittest
import numpy as np
from preprocessing import split_data, principal_components
class PreprocessingTest(unittest.TestCase):
def test_split_data_when_no_shuffle(self):
test_data = np.random.random(size=(10, 10))
base_train_data = test_data[0:9, :]
base_test_data = test_data[9:... | 1,616 | 22 | 104 |
d2f1f0254810a2662a6eeedc65ab86a947dfc312 | 2,703 | py | Python | threepy/core/Base.py | district10/three.py | e46a41267d210b8daecc2a0cc81350493132c8da | [
"MIT"
] | 2 | 2019-04-09T15:57:17.000Z | 2019-04-10T04:15:53.000Z | threepy/core/Base.py | district10/three.py | e46a41267d210b8daecc2a0cc81350493132c8da | [
"MIT"
] | null | null | null | threepy/core/Base.py | district10/three.py | e46a41267d210b8daecc2a0cc81350493132c8da | [
"MIT"
] | null | null | null | import pygame
import sys
import time
from threepy.core import *
import os
pwd = os.path.abspath(os.path.dirname(__file__))
# set window title
# WARNING: calling this method loses the original OpenGL context;
# only use before calling OpenGL functions
# implement by extending class
# implemen... | 28.452632 | 79 | 0.577876 | import pygame
import sys
import time
from threepy.core import *
import os
pwd = os.path.abspath(os.path.dirname(__file__))
class Base(object):
def __init__(self):
# initialize the pygame display and OpenGL context
pygame.display.init()
pygame.font.init()
# load a custom icon
... | 2,183 | -2 | 181 |
a2941e0e48351ce0154cdcae044ad2ff9fe3dea7 | 1,353 | py | Python | nmt/contrib/stat/parameter.py | Roxot/AEVNMT | 5ebc6ec76b2c891ab76a5584a15e735145fdc43b | [
"Apache-2.0"
] | 15 | 2018-07-30T13:19:58.000Z | 2019-10-20T13:58:10.000Z | nmt/contrib/stat/parameter.py | Roxot/AEVNMT | 5ebc6ec76b2c891ab76a5584a15e735145fdc43b | [
"Apache-2.0"
] | null | null | null | nmt/contrib/stat/parameter.py | Roxot/AEVNMT | 5ebc6ec76b2c891ab76a5584a15e735145fdc43b | [
"Apache-2.0"
] | null | null | null | """
Code to specify constraints on parameters of distributions.
:Authors: - Wilker Aziz
"""
import tensorflow as tf
class Parameter:
"""
This class helps predict parameters by setting an appropriate activation to convert from the real line
to some subset of it.
"""
class Location(Parameter):
""... | 21.47619 | 106 | 0.651885 | """
Code to specify constraints on parameters of distributions.
:Authors: - Wilker Aziz
"""
import tensorflow as tf
class Parameter:
"""
This class helps predict parameters by setting an appropriate activation to convert from the real line
to some subset of it.
"""
def __init__(self, activation_... | 428 | 0 | 162 |
cff3d0f7d9ee32251708111d01e0488ed57a3d55 | 1,426 | py | Python | venv/lib/python2.7/site-packages/pyowm/utils/stringutils.py | Shanka123/snips_assistant | 22603853f217008a7ebe68dd74c1f0651e3b7472 | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/pyowm/utils/stringutils.py | Shanka123/snips_assistant | 22603853f217008a7ebe68dd74c1f0651e3b7472 | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/pyowm/utils/stringutils.py | Shanka123/snips_assistant | 22603853f217008a7ebe68dd74c1f0651e3b7472 | [
"MIT"
] | null | null | null | def obfuscate_API_key(API_key):
"""
Return a mostly obfuscated version of the API Key
:param API_key: input string
:return: str
"""
if API_key is not None:
return (len(API_key)-8)*'*'+API_key[-8:]
def assert_is_string(value):
"""
Checks if the provided value is a valid string ... | 26.90566 | 81 | 0.643058 | def obfuscate_API_key(API_key):
"""
Return a mostly obfuscated version of the API Key
:param API_key: input string
:return: str
"""
if API_key is not None:
return (len(API_key)-8)*'*'+API_key[-8:]
def assert_is_string(value):
"""
Checks if the provided value is a valid string ... | 0 | 0 | 0 |
adcc4e014d353f6d283392e6cf350802cc86b9dc | 8,245 | py | Python | avocado/query/oldparsers/dataview.py | rysdyk/avocado | 655c1a766be616cb1357ddff8bc345ab61ae9e8a | [
"BSD-2-Clause"
] | null | null | null | avocado/query/oldparsers/dataview.py | rysdyk/avocado | 655c1a766be616cb1357ddff8bc345ab61ae9e8a | [
"BSD-2-Clause"
] | null | null | null | avocado/query/oldparsers/dataview.py | rysdyk/avocado | 655c1a766be616cb1357ddff8bc345ab61ae9e8a | [
"BSD-2-Clause"
] | 2 | 2020-01-13T20:40:09.000Z | 2020-01-16T15:26:11.000Z | from warnings import warn
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from modeltree.tree import trees
SORT_DIRECTIONS = ('asc', 'desc')
| 28.728223 | 78 | 0.568587 | from warnings import warn
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from modeltree.tree import trees
SORT_DIRECTIONS = ('asc', 'desc')
class Node(object):
def __init__(self, facets=None, **context):
self.facets = facets or []
self.tr... | 5,573 | 2,376 | 92 |
976e3081ec9e3b6a1b324179a3f61e2e4ab7a961 | 1,125 | py | Python | q1.py | cs-fullstack-2019-fall/codeassessment2-rjrobins16 | 446f4b95ab35e7d93f14596424b12a318cb6023e | [
"Apache-2.0"
] | null | null | null | q1.py | cs-fullstack-2019-fall/codeassessment2-rjrobins16 | 446f4b95ab35e7d93f14596424b12a318cb6023e | [
"Apache-2.0"
] | null | null | null | q1.py | cs-fullstack-2019-fall/codeassessment2-rjrobins16 | 446f4b95ab35e7d93f14596424b12a318cb6023e | [
"Apache-2.0"
] | null | null | null | # ### Problem 1
# Ask the user to enter a number.
# Using the provided list of numbers, use a for loop to iterate
# the array and print out all the values that are smaller than the user input and print
# out all the values that are larger than the number entered by the user.
# ```
# # Start with this List
list_of_man... | 33.088235 | 121 | 0.721778 | # ### Problem 1
# Ask the user to enter a number.
# Using the provided list of numbers, use a for loop to iterate
# the array and print out all the values that are smaller than the user input and print
# out all the values that are larger than the number entered by the user.
# ```
# # Start with this List
list_of_man... | 0 | 0 | 0 |
373115112003c34790c84aa0a64da3501e53d9f7 | 2,505 | py | Python | cping/protocols/tcp.py | hSaria/Pinger | 194ffe8bf4ab286d67803a78266a83bcb1208d45 | [
"MIT"
] | null | null | null | cping/protocols/tcp.py | hSaria/Pinger | 194ffe8bf4ab286d67803a78266a83bcb1208d45 | [
"MIT"
] | null | null | null | cping/protocols/tcp.py | hSaria/Pinger | 194ffe8bf4ab286d67803a78266a83bcb1208d45 | [
"MIT"
] | null | null | null | '''TCP ping.'''
import socket
import time
import cping.protocols
class Ping(cping.protocols.Ping):
'''TCP ping. The possible results:
* latency=x, error=False: successful TCP handshake
* latency=x, error=True: connection failure, like TCP-RST
* latency=-1, error=False: timeout
'''
... | 31.3125 | 79 | 0.531737 | '''TCP ping.'''
import socket
import time
import cping.protocols
class Ping(cping.protocols.Ping):
'''TCP ping. The possible results:
* latency=x, error=False: successful TCP handshake
* latency=x, error=True: connection failure, like TCP-RST
* latency=-1, error=False: timeout
'''
... | 1,537 | 0 | 53 |
e4dbefa0410d51c19a556ba81de7965bdb889eee | 7,345 | py | Python | modules/deco/algorithm.py | tandemdude/scubot | 32ba0700601d4f610ef00c9277181b3d3ae9d704 | [
"MIT"
] | null | null | null | modules/deco/algorithm.py | tandemdude/scubot | 32ba0700601d4f610ef00c9277181b3d3ae9d704 | [
"MIT"
] | null | null | null | modules/deco/algorithm.py | tandemdude/scubot | 32ba0700601d4f610ef00c9277181b3d3ae9d704 | [
"MIT"
] | null | null | null | from collections import namedtuple
from modules.deco.constants import DecoConstants
import math
import copy
from modules.deco.utilities import *
| 34.810427 | 105 | 0.608577 | from collections import namedtuple
from modules.deco.constants import DecoConstants
import math
import copy
from modules.deco.utilities import *
class DecoAlgorithm(DecoConstants):
# Gas structures
Gas = namedtuple("Gas", "FrN2 FrO2 FrHe")
Gases = [Gas(0.79, 0.21, 0)]
GasNames = {'Air': 0}
# De... | 6,141 | 1,036 | 23 |
49216b9511d897ce7802fa8114cb589b0d073ab5 | 1,736 | py | Python | app/dashboard/admin.py | fxavier/sysgenesis | 5a405fd2c6cb35d7a335f233a1c667465499c381 | [
"MIT"
] | null | null | null | app/dashboard/admin.py | fxavier/sysgenesis | 5a405fd2c6cb35d7a335f233a1c667465499c381 | [
"MIT"
] | null | null | null | app/dashboard/admin.py | fxavier/sysgenesis | 5a405fd2c6cb35d7a335f233a1c667465499c381 | [
"MIT"
] | null | null | null | from django.contrib import admin
from import_export.admin import ImportExportMixin
from dashboard.models import Inquerito, TipoSementeGerminou, TipoAreaGerminacao, VerificacaoSementes, RowControl, Sementeira
admin.site.site_header = 'Genesis App Administration'
admin.site.register(Inquerito, InqueritoAdmin)
admin... | 44.512821 | 124 | 0.769585 | from django.contrib import admin
from import_export.admin import ImportExportMixin
from dashboard.models import Inquerito, TipoSementeGerminou, TipoAreaGerminacao, VerificacaoSementes, RowControl, Sementeira
class InqueritoAdmin(ImportExportMixin, admin.ModelAdmin):
ordering = ["nome_agg_familiar", ]
list_d... | 0 | 1,046 | 127 |
81f9d87f0c8ce034264bba1b60fe9562531b7cd8 | 495 | py | Python | utils/custom_exception.py | xiaoxin1992/bind-pod | 30eda8f0fd5a374bee3548a103dcb0d99fa39630 | [
"MIT"
] | 12 | 2020-10-21T05:05:15.000Z | 2022-01-12T03:21:39.000Z | utils/custom_exception.py | xiaoxin1992/bind-pod | 30eda8f0fd5a374bee3548a103dcb0d99fa39630 | [
"MIT"
] | 2 | 2021-11-11T03:04:32.000Z | 2022-02-08T10:12:14.000Z | utils/custom_exception.py | xiaoxin1992/bind-pod | 30eda8f0fd5a374bee3548a103dcb0d99fa39630 | [
"MIT"
] | 5 | 2020-11-03T10:20:46.000Z | 2021-12-27T07:00:46.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from rest_framework.views import exception_handler
| 27.5 | 63 | 0.656566 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from rest_framework.views import exception_handler
def custom_exception_handler(exc, context):
if getattr(exc, "default_code", "") == "not_authenticated":
exc.status_code = 401
response = exception_handler(exc, context)
if response i... | 355 | 0 | 23 |
0ffe93f994b4b00feebe9a887cd16c2265e03664 | 153 | py | Python | twitter_data/urls.py | akshaylulla/stock_tweets | 6540b13b4ecf2e4d81af145286930dda09af0788 | [
"MIT"
] | 2 | 2021-01-13T00:33:03.000Z | 2021-06-27T06:44:56.000Z | twitter_data/urls.py | akshaylulla/stock_tweets | 6540b13b4ecf2e4d81af145286930dda09af0788 | [
"MIT"
] | null | null | null | twitter_data/urls.py | akshaylulla/stock_tweets | 6540b13b4ecf2e4d81af145286930dda09af0788 | [
"MIT"
] | null | null | null | from django.urls import path
from twitter_data.views import HomeView
from . import views
urlpatterns = [
path('', HomeView.as_view(), name='home')
] | 21.857143 | 45 | 0.732026 | from django.urls import path
from twitter_data.views import HomeView
from . import views
urlpatterns = [
path('', HomeView.as_view(), name='home')
] | 0 | 0 | 0 |
d29245e8ae2ce48edb38e194ed770eceba29df5e | 1,670 | py | Python | nabu/neuralnetworks/loss_computers/deepattractornetnoise_soft_loss.py | Darleen2019/Nabu-MSSS | 5e862cbf846d45b8a317f87588533f3fde9f0726 | [
"MIT"
] | 18 | 2017-10-16T13:12:46.000Z | 2022-02-15T01:20:00.000Z | nabu/neuralnetworks/loss_computers/deepattractornetnoise_soft_loss.py | Darleen2019/Nabu-MSSS | 5e862cbf846d45b8a317f87588533f3fde9f0726 | [
"MIT"
] | null | null | null | nabu/neuralnetworks/loss_computers/deepattractornetnoise_soft_loss.py | Darleen2019/Nabu-MSSS | 5e862cbf846d45b8a317f87588533f3fde9f0726 | [
"MIT"
] | 9 | 2017-10-03T18:10:10.000Z | 2020-11-13T08:26:31.000Z | """@file deepattractornetnoise_soft_loss.py
contains the DeepattractornetnoisesoftLoss"""
import loss_computer
from nabu.neuralnetworks.components import ops
class DeepattractornetnoisesoftLoss(loss_computer.LossComputer):
"""A loss computer that calculates the loss"""
def __call__(self, targets, logits, se... | 35.531915 | 115 | 0.669461 | """@file deepattractornetnoise_soft_loss.py
contains the DeepattractornetnoisesoftLoss"""
import loss_computer
from nabu.neuralnetworks.components import ops
class DeepattractornetnoisesoftLoss(loss_computer.LossComputer):
"""A loss computer that calculates the loss"""
def __call__(self, targets, logits, se... | 0 | 0 | 0 |
83cd20a60431566c79603c5d32732f96e8a64e60 | 792 | py | Python | datacatalog/formats/ginkgo/convert.py | SD2E/python-datacatalog | 51ab366639505fb6e8a14cd6b446de37080cd20d | [
"CNRI-Python"
] | null | null | null | datacatalog/formats/ginkgo/convert.py | SD2E/python-datacatalog | 51ab366639505fb6e8a14cd6b446de37080cd20d | [
"CNRI-Python"
] | 2 | 2019-07-25T15:39:04.000Z | 2019-10-21T15:31:46.000Z | datacatalog/formats/ginkgo/convert.py | SD2E/python-datacatalog | 51ab366639505fb6e8a14cd6b446de37080cd20d | [
"CNRI-Python"
] | 1 | 2019-10-15T14:33:44.000Z | 2019-10-15T14:33:44.000Z | import sys
from ..converter import Converter, ConversionError, ValidationError
class Ginkgo(Converter):
"""Convert Transcriptic samples.json to sample-set schema"""
VERSION = '0.0.2'
FILENAME = 'ginkgo_samples'
def convert(self, input_fp, output_fp=None, verbose=True, config={}, enforce_validation=Tru... | 44 | 98 | 0.628788 | import sys
from ..converter import Converter, ConversionError, ValidationError
class Ginkgo(Converter):
"""Convert Transcriptic samples.json to sample-set schema"""
VERSION = '0.0.2'
FILENAME = 'ginkgo_samples'
def convert(self, input_fp, output_fp=None, verbose=True, config={}, enforce_validation=Tru... | 0 | 0 | 0 |
4ef671806bd1627a2cc4a599914a121185433408 | 666 | py | Python | src/lib/decoders/__init__.py | sankhaMukherjee/scrapDrugs | d62e978cdd1b99616129c64b28eb4591f08cbdeb | [
"MIT"
] | null | null | null | src/lib/decoders/__init__.py | sankhaMukherjee/scrapDrugs | d62e978cdd1b99616129c64b28eb4591f08cbdeb | [
"MIT"
] | null | null | null | src/lib/decoders/__init__.py | sankhaMukherjee/scrapDrugs | d62e978cdd1b99616129c64b28eb4591f08cbdeb | [
"MIT"
] | null | null | null | '''Module containing decoders for different websited
This module contains decoders for decoding information from
various websites. Any new website that needs to be added
will contain information about how a particular website is to
be decoded over here. You should include modules here as they
become important.
The f... | 26.64 | 63 | 0.726727 | '''Module containing decoders for different websited
This module contains decoders for decoding information from
various websites. Any new website that needs to be added
will contain information about how a particular website is to
be decoded over here. You should include modules here as they
become important.
The f... | 0 | 0 | 0 |
a26522302af02e9c03efb369c14c4be8629d1885 | 79 | py | Python | frontend/__init__.py | AzoeDesarrollos/PyMavisDatabase | bfcd0557f63a4d8a73f0f8e891c47b47a1de1b45 | [
"MIT"
] | null | null | null | frontend/__init__.py | AzoeDesarrollos/PyMavisDatabase | bfcd0557f63a4d8a73f0f8e891c47b47a1de1b45 | [
"MIT"
] | 2 | 2019-10-05T14:20:11.000Z | 2019-10-05T14:22:31.000Z | frontend/__init__.py | AzoeDesarrollos/PyMavisDatabase | bfcd0557f63a4d8a73f0f8e891c47b47a1de1b45 | [
"MIT"
] | null | null | null | from .globals import Renderer, WidgetHandler
from .globals.constantes import *
| 26.333333 | 44 | 0.822785 | from .globals import Renderer, WidgetHandler
from .globals.constantes import *
| 0 | 0 | 0 |
33758babb0762045e32d822ff56c0fc5d3aae33c | 709 | py | Python | atest/testdata/test_libraries/as_listener/multiple_listenerlibrary.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 9 | 2020-04-22T08:30:52.000Z | 2020-12-07T08:25:09.000Z | atest/testdata/test_libraries/as_listener/multiple_listenerlibrary.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 63 | 2020-03-04T17:31:39.000Z | 2022-03-01T09:12:16.000Z | atest/testdata/test_libraries/as_listener/multiple_listenerlibrary.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2016-02-29T15:42:22.000Z | 2018-05-08T08:58:18.000Z | from listenerlibrary import listenerlibrary
| 28.36 | 54 | 0.623413 | from listenerlibrary import listenerlibrary
class multiple_listenerlibrary(object):
def __init__(self, fail=False):
self.instances = [
listenerlibrary(),
listenerlibrary(),
]
if fail:
class NoVersionListener(object):
def events_should_be... | 542 | 18 | 104 |
07ae5a235d0f19ace98631ac28736ed8e7fc43c9 | 591 | py | Python | Day5/Remove_nth_node_from_end_of_linked_list.py | DsaWithPython/Striver_SDE_SHEET_python | 1fe343a8d3388de91d289306284881ec2d2e5f26 | [
"MIT"
] | 1 | 2022-02-11T13:13:47.000Z | 2022-02-11T13:13:47.000Z | Day5/Remove_nth_node_from_end_of_linked_list.py | DsaWithPython/Striver_SDE_SHEET_python | 1fe343a8d3388de91d289306284881ec2d2e5f26 | [
"MIT"
] | null | null | null | Day5/Remove_nth_node_from_end_of_linked_list.py | DsaWithPython/Striver_SDE_SHEET_python | 1fe343a8d3388de91d289306284881ec2d2e5f26 | [
"MIT"
] | null | null | null | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
| 26.863636 | 87 | 0.538071 | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def removeNthFromEnd(self, head: Optional[ListNode], n: int) -> Optional[ListNode]:
start = ListNode()
start.next = head
fast... | 389 | -6 | 48 |
6b0f317fdd2b0fad91f85c78c07c36caac9a22b0 | 664 | py | Python | tests/test_cmd_cancel.py | thyjukki/Civi-Botti-2.0 | 7b9ff6bf3e97b90f61286e7688db731f91365e88 | [
"MIT"
] | null | null | null | tests/test_cmd_cancel.py | thyjukki/Civi-Botti-2.0 | 7b9ff6bf3e97b90f61286e7688db731f91365e88 | [
"MIT"
] | 3 | 2020-04-28T09:19:11.000Z | 2021-06-01T23:21:32.000Z | tests/test_cmd_cancel.py | thyjukki/Civi-Botti-2.0 | 7b9ff6bf3e97b90f61286e7688db731f91365e88 | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import Mock, patch
from telegram.ext import ConversationHandler
from civbot.commands import cmd_cancel
| 28.869565 | 95 | 0.728916 | from unittest import TestCase
from unittest.mock import Mock, patch
from telegram.ext import ConversationHandler
from civbot.commands import cmd_cancel
class TestCancelAll(TestCase):
@patch('telegram.ReplyKeyboardRemove')
def test_cancel_all_should_cancel(self, mock_keyboard):
mock_keyboard.return_v... | 408 | 78 | 23 |
122080cc117e09bd7a3e963c093135533439d9bb | 3,816 | py | Python | sysmpy/matrix_for_graph.py | pcyoung75/SysMPy | 2684e28eb8ad63c351e3327591bc2d988480e6a3 | [
"Apache-2.0"
] | null | null | null | sysmpy/matrix_for_graph.py | pcyoung75/SysMPy | 2684e28eb8ad63c351e3327591bc2d988480e6a3 | [
"Apache-2.0"
] | null | null | null | sysmpy/matrix_for_graph.py | pcyoung75/SysMPy | 2684e28eb8ad63c351e3327591bc2d988480e6a3 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from sysmpy.entity import *
from operator import add
# Test ###############################################################
# mn = MatrixForGraph(np.matrix([[1, 2, 3], [3, 4, 5], [6, 7, 8]]))
# print(mn.sum_column())
| 31.02439 | 102 | 0.492925 | import numpy as np
from sysmpy.entity import *
from operator import add
class MatrixForGraph():
def __init__(self, m=None):
self.m = m
self.entity = None
def sum_upper_diagonal(self, m=None):
if m is None:
m = self.m
ret_matrix = np.zeros(m.shape)
for x in ... | 2,227 | 1,327 | 23 |
bdc1620eb52cc9e2d6cc7a6a615baa7d381aa6b8 | 28,939 | py | Python | lib/fast_rcnn/train_comb.py | yanxp/Weakly-object-detection | ffb3ac5f745bf6977b870b90c807b75e4d83cfb7 | [
"MIT"
] | 2 | 2018-02-14T15:58:04.000Z | 2019-12-05T07:38:39.000Z | lib/fast_rcnn/train_comb.py | yanxp/Weakly-object-detection | ffb3ac5f745bf6977b870b90c807b75e4d83cfb7 | [
"MIT"
] | null | null | null | lib/fast_rcnn/train_comb.py | yanxp/Weakly-object-detection | ffb3ac5f745bf6977b870b90c807b75e4d83cfb7 | [
"MIT"
] | 3 | 2018-03-24T09:06:23.000Z | 2020-07-03T01:07:57.000Z | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Train a Fast R-CNN network."""
import caffe
from fast_rcnn... | 46.978896 | 231 | 0.530115 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Train a Fast R-CNN network."""
import caffe
from fast_rcnn... | 21,634 | 0 | 159 |
6251c1812efbf5e49d8f9ded518100c8ef6a2a0a | 680 | py | Python | minus80_main.py | nikki-t/minus80 | 4c3075c69cc00da2276695d2353f21e9be140f6e | [
"MIT"
] | null | null | null | minus80_main.py | nikki-t/minus80 | 4c3075c69cc00da2276695d2353f21e9be140f6e | [
"MIT"
] | null | null | null | minus80_main.py | nikki-t/minus80 | 4c3075c69cc00da2276695d2353f21e9be140f6e | [
"MIT"
] | null | null | null | """Program that monitors a Raspberry Pi attached to a minus 80 freezer.
Functions
---------
monitor(): Creates Board object to watch the state of an input pin.
"""
# Local application imports
from app.Board import Board
PIN = 11
def monitor():
"""Creates a Board object to monitor the state of an input pin."... | 21.935484 | 71 | 0.65 | """Program that monitors a Raspberry Pi attached to a minus 80 freezer.
Functions
---------
monitor(): Creates Board object to watch the state of an input pin.
"""
# Local application imports
from app.Board import Board
PIN = 11
def monitor():
"""Creates a Board object to monitor the state of an input pin."... | 0 | 0 | 0 |
db1b947d4cd98708096ef8e54e90ee5cade83492 | 26 | py | Python | stop/__init__.py | iboraham/senior-project | 766fa2c9dd8b4beaa85d48ef71e3c70b525beef2 | [
"MIT"
] | 1 | 2021-01-28T07:55:26.000Z | 2021-01-28T07:55:26.000Z | stop/__init__.py | iboraham/senior-project | 766fa2c9dd8b4beaa85d48ef71e3c70b525beef2 | [
"MIT"
] | null | null | null | stop/__init__.py | iboraham/senior-project | 766fa2c9dd8b4beaa85d48ef71e3c70b525beef2 | [
"MIT"
] | 2 | 2020-02-03T11:30:44.000Z | 2020-02-03T11:58:06.000Z | import stop
stop.main()
| 5.2 | 11 | 0.692308 | import stop
stop.main()
| 0 | 0 | 0 |
9fdce1bafc925e55e6d01874d1887ad7f9b1aebf | 467 | py | Python | Commands/bing.py | koolguru/Bunny2020 | 5a78739e6cd12507c0e74cb4d6a609238cf1f38a | [
"MIT"
] | 1 | 2020-04-12T02:45:43.000Z | 2020-04-12T02:45:43.000Z | Commands/bing.py | koolguru/Bunny2020 | 5a78739e6cd12507c0e74cb4d6a609238cf1f38a | [
"MIT"
] | 5 | 2020-04-12T01:00:57.000Z | 2020-04-12T01:01:00.000Z | Commands/bing.py | koolguru/Bunny2020 | 5a78739e6cd12507c0e74cb4d6a609238cf1f38a | [
"MIT"
] | null | null | null | from command import Command
| 19.458333 | 65 | 0.492505 | from command import Command
class Bing(Command):
def __init__(self):
super()
return
def get_response(self, arg=None):
if arg:
return 'https://www.bing.com/search?q={}'.format(arg)
else:
return 'http://www.bing.com'
def get_keywords(self... | 297 | -1 | 143 |
edd0106fc9ccdbad9a7e40451021c5efbdc7d8c7 | 1,428 | py | Python | CompetitiveProgramming/CodeChef/P40_COINS.py | Sahil2rick/School-PythonProject | e7a8c283446bf773c4456930f77c8c85c40f593c | [
"MIT"
] | null | null | null | CompetitiveProgramming/CodeChef/P40_COINS.py | Sahil2rick/School-PythonProject | e7a8c283446bf773c4456930f77c8c85c40f593c | [
"MIT"
] | null | null | null | CompetitiveProgramming/CodeChef/P40_COINS.py | Sahil2rick/School-PythonProject | e7a8c283446bf773c4456930f77c8c85c40f593c | [
"MIT"
] | null | null | null | # In Byteland they have a very strange monetary system.
#
# Each Bytelandian gold coin has an integer number written on it. A coin n can be exchanged in a bank into
# three coins: n/2, n/3 and n/4. But these numbers are all rounded down (the banks have to make a profit).
#
# You can also sell Bytelandian coins for Amer... | 29.75 | 108 | 0.670868 | # In Byteland they have a very strange monetary system.
#
# Each Bytelandian gold coin has an integer number written on it. A coin n can be exchanged in a bank into
# three coins: n/2, n/3 and n/4. But these numbers are all rounded down (the banks have to make a profit).
#
# You can also sell Bytelandian coins for Amer... | 181 | 0 | 22 |
344fbec7af64b28bb0afae054b8d5a26e30c93e4 | 1,131 | py | Python | qcm/models/questionsset.py | thenchoz/Django_ERA_Lessons_training | e02d775526f76c7ab43ef5e8b1029802e5fa58db | [
"MIT"
] | null | null | null | qcm/models/questionsset.py | thenchoz/Django_ERA_Lessons_training | e02d775526f76c7ab43ef5e8b1029802e5fa58db | [
"MIT"
] | null | null | null | qcm/models/questionsset.py | thenchoz/Django_ERA_Lessons_training | e02d775526f76c7ab43ef5e8b1029802e5fa58db | [
"MIT"
] | null | null | null | """
QuestionsSet model
"""
from random import random
from django.db import models
from polymorphic.models import PolymorphicModel
class QuestionsSet(PolymorphicModel):
"""Abstract class, another way of regrouping question"""
name = models.CharField(max_length=100)
def get_branch_id(self):
"""g... | 26.302326 | 88 | 0.668435 | """
QuestionsSet model
"""
from random import random
from django.db import models
from polymorphic.models import PolymorphicModel
class QuestionsSet(PolymorphicModel):
"""Abstract class, another way of regrouping question"""
name = models.CharField(max_length=100)
def __str__(self):
return sel... | 22 | 0 | 27 |
6fa28a2b39b27960f4098ed7da8b5885555cadd7 | 556 | py | Python | sort/cocktail.py | Wind2esg/python3sort | ead213f75a54da7d476865e3cf0a551ab0970d7d | [
"MIT"
] | 1 | 2018-01-30T04:44:05.000Z | 2018-01-30T04:44:05.000Z | sort/cocktail.py | Wind2esg/python3sort | ead213f75a54da7d476865e3cf0a551ab0970d7d | [
"MIT"
] | null | null | null | sort/cocktail.py | Wind2esg/python3sort | ead213f75a54da7d476865e3cf0a551ab0970d7d | [
"MIT"
] | null | null | null | # python3 sort <http://github.com/Wind2esg/python3sort>
# Copyright 2018 Wind2esg
# Released under the MIT license <http://github.com/Wind2esg/python3sort/LICENSE>
from _comparer import int_comparer
| 29.263158 | 81 | 0.613309 | # python3 sort <http://github.com/Wind2esg/python3sort>
# Copyright 2018 Wind2esg
# Released under the MIT license <http://github.com/Wind2esg/python3sort/LICENSE>
from _comparer import int_comparer
def cocktail(array, compare=int_comparer):
left = 0
right = len(array) - 1
step = 1
while left != righ... | 332 | 0 | 23 |
c3540fb02e938bcb40744e281324939bc5d4fac3 | 844 | py | Python | httpx_scraper.py | msec1203/Scrape-With-Httpx | 161fb4597e867f87b511b2e4319c40858846667e | [
"MIT"
] | null | null | null | httpx_scraper.py | msec1203/Scrape-With-Httpx | 161fb4597e867f87b511b2e4319c40858846667e | [
"MIT"
] | null | null | null | httpx_scraper.py | msec1203/Scrape-With-Httpx | 161fb4597e867f87b511b2e4319c40858846667e | [
"MIT"
] | null | null | null | __author__ = "Michael Rippey @nahamike01"
__date__ = "2020/05/26"
"""
Author: Michael Rippey (c) 2020
Copyright 2020 Michael Rippey
See LICENSE.md for details
"""
import httpx
from bs4 import BeautifulSoup
import urllib
import sys
scrape_news_articles('https://cybersecurity-jp.com') | 22.210526 | 65 | 0.675355 | __author__ = "Michael Rippey @nahamike01"
__date__ = "2020/05/26"
"""
Author: Michael Rippey (c) 2020
Copyright 2020 Michael Rippey
See LICENSE.md for details
"""
import httpx
from bs4 import BeautifulSoup
import urllib
import sys
def scrape_news_articles(site_name):
news_links = []
target_url = site_name
... | 514 | 0 | 23 |
ed722fe4a2c5e9f16687fb5ad595286c819816b5 | 2,511 | py | Python | utils/mailsender.py | myinxd/cavdet | 7a3eddfb9c94223ce35dc7133bfa7e2e7545df25 | [
"MIT"
] | null | null | null | utils/mailsender.py | myinxd/cavdet | 7a3eddfb9c94223ce35dc7133bfa7e2e7545df25 | [
"MIT"
] | null | null | null | utils/mailsender.py | myinxd/cavdet | 7a3eddfb9c94223ce35dc7133bfa7e2e7545df25 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
A simple tool to send email by python
References
----------
[1] http://jingyan.baidu.com/article/b24f6c822784b886bfe5dabe.html
[2] email https://docs.python.org/3.4/library/email.mime.html
"""
import smtplib
from email.mime.text import MIMEText
import argparse
def send_mail(from_user, from... | 27.593407 | 79 | 0.649144 | #!/usr/bin/env python3
"""
A simple tool to send email by python
References
----------
[1] http://jingyan.baidu.com/article/b24f6c822784b886bfe5dabe.html
[2] email https://docs.python.org/3.4/library/email.mime.html
"""
import smtplib
from email.mime.text import MIMEText
import argparse
def send_mail(from_user, from... | 0 | 0 | 0 |
521fc50aa6050f22a5d3bb1014b1b057c4b2d02d | 1,810 | py | Python | pps/helper.py | SeungUkLee/preview-pipfile-script | d28d963f1feee9ed1621a04b25c02d34a0919829 | [
"MIT"
] | null | null | null | pps/helper.py | SeungUkLee/preview-pipfile-script | d28d963f1feee9ed1621a04b25c02d34a0919829 | [
"MIT"
] | null | null | null | pps/helper.py | SeungUkLee/preview-pipfile-script | d28d963f1feee9ed1621a04b25c02d34a0919829 | [
"MIT"
] | null | null | null | """
Functions that help the run 'pps' command
"""
import functools
import subprocess
import inquirer
import toml
from .message import (
FILE_NOT_FOUND_MSG,
INQUIRER_MSG,
KEYBOARD_INTERRUPT_MSG,
KEYWORD_NOT_FOUND_MSG,
)
def exception(function):
"""
A decorator that wraps the passed in functio... | 21.294118 | 76 | 0.650276 | """
Functions that help the run 'pps' command
"""
import functools
import subprocess
import inquirer
import toml
from .message import (
FILE_NOT_FOUND_MSG,
INQUIRER_MSG,
KEYBOARD_INTERRUPT_MSG,
KEYWORD_NOT_FOUND_MSG,
)
def exception(function):
"""
A decorator that wraps the passed in functio... | 337 | 0 | 26 |
63f1df255790541ba79ebcc499476f5730078a82 | 3,839 | py | Python | saq/indicators/__init__.py | ace-ecosystem/ACE | d17b5ef4bccf923ec6be5115fabe40f0627dab2d | [
"Apache-2.0"
] | 24 | 2019-09-21T21:09:45.000Z | 2022-03-15T19:48:13.000Z | saq/indicators/__init__.py | ace-ecosystem/ACE | d17b5ef4bccf923ec6be5115fabe40f0627dab2d | [
"Apache-2.0"
] | 54 | 2019-09-16T20:06:30.000Z | 2021-08-18T22:22:08.000Z | saq/indicators/__init__.py | ace-ecosystem/ACE | d17b5ef4bccf923ec6be5115fabe40f0627dab2d | [
"Apache-2.0"
] | 9 | 2019-09-08T13:35:55.000Z | 2021-01-03T15:23:37.000Z | import ipaddress
import logging
import tld
from collections import UserList
from typing import Iterable, List, Union
from urlfinderlib.url import URL
from urllib.parse import urlsplit
from saq.constants import *
| 32.260504 | 116 | 0.595989 | import ipaddress
import logging
import tld
from collections import UserList
from typing import Iterable, List, Union
from urlfinderlib.url import URL
from urllib.parse import urlsplit
from saq.constants import *
class Indicator:
def __init__(self, type: str, value: str, status: str = 'New', tags: Iterable[str] ... | 3,147 | 430 | 46 |
766058f5d5e85857d99f526b2acc3c2e2ec9fca4 | 6,226 | py | Python | tests/cid_utbase.py | futoin/citool | 872ecca94fb637fa4e5e79cb62c240e774e3cd83 | [
"Apache-2.0"
] | 13 | 2017-04-05T22:19:15.000Z | 2017-11-23T21:02:26.000Z | tests/cid_utbase.py | futoin/cid-tool | 872ecca94fb637fa4e5e79cb62c240e774e3cd83 | [
"Apache-2.0"
] | 77 | 2017-04-01T07:47:15.000Z | 2019-06-04T14:23:16.000Z | tests/cid_utbase.py | futoin/citool | 872ecca94fb637fa4e5e79cb62c240e774e3cd83 | [
"Apache-2.0"
] | 3 | 2017-05-13T09:28:50.000Z | 2017-11-17T06:42:49.000Z | #
# Copyright 2015-2020 Andrey Galkin <andrey@futoin.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 29.367925 | 119 | 0.560553 | #
# Copyright 2015-2020 Andrey Galkin <andrey@futoin.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 3,795 | 1,330 | 54 |
b9753f0e9c40ce23710e1f55400dc44bda48b295 | 4,528 | py | Python | test/unittest/datafinder_test/core/configuration/icons/icon_test.py | schlauch/DataFinder | 958fda4f3064f9f6b2034da396a20ac9d9abd52f | [
"BSD-3-Clause"
] | 9 | 2016-05-25T06:12:52.000Z | 2021-04-30T07:22:48.000Z | test/unittest/datafinder_test/core/configuration/icons/icon_test.py | schlauch/DataFinder | 958fda4f3064f9f6b2034da396a20ac9d9abd52f | [
"BSD-3-Clause"
] | 6 | 2016-03-29T13:38:18.000Z | 2017-01-18T15:57:42.000Z | test/unittest/datafinder_test/core/configuration/icons/icon_test.py | schlauch/DataFinder | 958fda4f3064f9f6b2034da396a20ac9d9abd52f | [
"BSD-3-Clause"
] | 7 | 2016-06-15T12:01:22.000Z | 2022-03-05T08:50:25.000Z | # $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are
#met:
#
... | 43.961165 | 99 | 0.667403 | # $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are
#met:
#
... | 0 | 0 | 0 |
20d5c99c25391b1d8ad49c1cb5ac96c37b7d338b | 2,947 | py | Python | scripts/summit_scripts/test_namsa_mpi.py | nlaanait/namsa | 55f82ecf1c82601fcb81815d5e60705506c01e1e | [
"MIT"
] | null | null | null | scripts/summit_scripts/test_namsa_mpi.py | nlaanait/namsa | 55f82ecf1c82601fcb81815d5e60705506c01e1e | [
"MIT"
] | null | null | null | scripts/summit_scripts/test_namsa_mpi.py | nlaanait/namsa | 55f82ecf1c82601fcb81815d5e60705506c01e1e | [
"MIT"
] | null | null | null | from namsa import SupercellBuilder, MSAMPI
from namsa.utils import imageTile
import numpy as np
from time import time
import sys
import h5py
from mpi4py import MPI
import os
comm = MPI.COMM_WORLD
comm_size = comm.Get_size()
comm_rank = comm.Get_rank()
#job_pid = os.environ.get('LS_JOBPID')
#job_id = os.environ.get('L... | 34.670588 | 104 | 0.628096 | from namsa import SupercellBuilder, MSAMPI
from namsa.utils import imageTile
import numpy as np
from time import time
import sys
import h5py
from mpi4py import MPI
import os
comm = MPI.COMM_WORLD
comm_size = comm.Get_size()
comm_rank = comm.Get_rank()
#job_pid = os.environ.get('LS_JOBPID')
#job_id = os.environ.get('L... | 1,514 | 0 | 23 |
f5a79231e1d9232ec6bae523c114ba0801e434fa | 1,538 | py | Python | core/database.py | METS-Programme/ugandaemr-scripts | 7aa3f8d05e97561d84d1e193e4b0b4a09632c44e | [
"MIT"
] | null | null | null | core/database.py | METS-Programme/ugandaemr-scripts | 7aa3f8d05e97561d84d1e193e4b0b4a09632c44e | [
"MIT"
] | 1 | 2016-11-02T16:17:50.000Z | 2016-11-02T16:17:50.000Z | core/database.py | METS-Programme/ugandaemr-scripts | 7aa3f8d05e97561d84d1e193e4b0b4a09632c44e | [
"MIT"
] | 2 | 2016-10-26T18:20:18.000Z | 2017-08-20T09:02:15.000Z | import MySQLdb
| 29.576923 | 87 | 0.550715 | import MySQLdb
class Database:
host = 'localhost'
user = 'openmrs'
password = 'openmrs'
db = 'openmrs'
def __init__(self):
self.connection = MySQLdb.connect(self.host, self.user, self.password, self.db)
self.cursor = self.connection.cursor()
def insert(self, q, d):
tr... | 1,255 | 244 | 23 |
e10612b06875ba9895be8483b88e3024aebc4dc2 | 268 | py | Python | ResortTemplate/views.py | jpriggs/resort-template | 857f992ff91c8246042f026d1f8942650d03c2aa | [
"MIT"
] | null | null | null | ResortTemplate/views.py | jpriggs/resort-template | 857f992ff91c8246042f026d1f8942650d03c2aa | [
"MIT"
] | null | null | null | ResortTemplate/views.py | jpriggs/resort-template | 857f992ff91c8246042f026d1f8942650d03c2aa | [
"MIT"
] | null | null | null | import os
from flask import Flask, render_template, url_for
basedir = os.path.abspath(os.path.dirname(__file__))
app = Flask(__name__)
# Views
@app.route('/')
if __name__ == "__main__":
app.run(debug=True)
| 17.866667 | 52 | 0.712687 | import os
from flask import Flask, render_template, url_for
basedir = os.path.abspath(os.path.dirname(__file__))
app = Flask(__name__)
# Views
@app.route('/')
def index():
return render_template("index.html")
if __name__ == "__main__":
app.run(debug=True)
| 32 | 0 | 22 |
f43afcad9e59c8e4b1be905496080f7d09321427 | 1,851 | py | Python | splinter/browser.py | kidosoft/splinter | 6d5052fd73c0a626299574cea76924e367c67faa | [
"BSD-3-Clause"
] | 2 | 2021-01-24T20:07:03.000Z | 2021-12-09T06:23:28.000Z | splinter/browser.py | kidosoft/splinter | 6d5052fd73c0a626299574cea76924e367c67faa | [
"BSD-3-Clause"
] | null | null | null | splinter/browser.py | kidosoft/splinter | 6d5052fd73c0a626299574cea76924e367c67faa | [
"BSD-3-Clause"
] | 1 | 2015-01-09T02:04:45.000Z | 2015-01-09T02:04:45.000Z | # -*- coding: utf-8 -*-
# Copyright 2012 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import sys
from splinter.driver.webdriver.firefox import WebDriver as FirefoxWebDriver
from splinter.driver.webdriver.remote import Web... | 28.921875 | 79 | 0.729876 | # -*- coding: utf-8 -*-
# Copyright 2012 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import sys
from splinter.driver.webdriver.firefox import WebDriver as FirefoxWebDriver
from splinter.driver.webdriver.remote import Web... | 0 | 0 | 0 |
bfacd85fe0047543d3ddeeb476baefaedc6a4674 | 18,330 | py | Python | scripts/find_subtypes.py | jefftc/changlab | 11da8c415afefcba0b0216238387c75aeb3a56ac | [
"MIT"
] | 9 | 2017-01-13T02:38:41.000Z | 2021-04-08T00:44:39.000Z | scripts/find_subtypes.py | jefftc/changlab | 11da8c415afefcba0b0216238387c75aeb3a56ac | [
"MIT"
] | null | null | null | scripts/find_subtypes.py | jefftc/changlab | 11da8c415afefcba0b0216238387c75aeb3a56ac | [
"MIT"
] | 4 | 2017-01-05T16:25:25.000Z | 2019-12-12T20:07:38.000Z | #!/usr/bin/env python
# make_file_layout
# init_paths
#
# align_dataset
# write_dataset
# write_selap_dataset
# write_model
# check_model
#
# make_model
# predict_subgroups
#
# summarize_predictions
# summarize_heatmap
# summarize_subgroups
# A SELAP model file contains:
# mu.txt SELAPver3 nvar x nclust
# s... | 34.914286 | 79 | 0.657883 | #!/usr/bin/env python
# make_file_layout
# init_paths
#
# align_dataset
# write_dataset
# write_selap_dataset
# write_model
# check_model
#
# make_model
# predict_subgroups
#
# summarize_predictions
# summarize_heatmap
# summarize_subgroups
# A SELAP model file contains:
# mu.txt SELAPver3 nvar x nclust
# s... | 17,436 | 0 | 303 |
897ecb2108508f4f90ff14647a4035357cb66b02 | 6,918 | py | Python | zfused_api/step.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | 2 | 2019-02-22T03:33:26.000Z | 2019-02-23T03:29:26.000Z | zfused_api/step.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | null | null | null | zfused_api/step.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
# --author-- lanhua.zhou
from __future__ import print_function
import os
import json
import datetime
import logging
import zfused_api
# read database
DATABASE_PATH = os.path.dirname(os.path.dirname(__file__))
STEP_DATABASE_FILE = "{}/database/step.json".format(DATABASE_PATH)
PROJECT_STEP_DATABASE_FILE... | 30.342105 | 127 | 0.559121 | # coding:utf-8
# --author-- lanhua.zhou
from __future__ import print_function
import os
import json
import datetime
import logging
import zfused_api
# read database
DATABASE_PATH = os.path.dirname(os.path.dirname(__file__))
STEP_DATABASE_FILE = "{}/database/step.json".format(DATABASE_PATH)
PROJECT_STEP_DATABASE_FILE... | 2,330 | 3,336 | 46 |
3f6bfab67478a1f5ff21be0d9e63bf09ba8810b0 | 624 | py | Python | better_guessing_game.py | wdmwilcox/guessinggames | 07f51e33ab92e4e79e33411d03ba074066e42c10 | [
"MIT"
] | null | null | null | better_guessing_game.py | wdmwilcox/guessinggames | 07f51e33ab92e4e79e33411d03ba074066e42c10 | [
"MIT"
] | null | null | null | better_guessing_game.py | wdmwilcox/guessinggames | 07f51e33ab92e4e79e33411d03ba074066e42c10 | [
"MIT"
] | null | null | null | # import
import random
import time
# main
main()
| 21.517241 | 54 | 0.623397 | # import
import random
import time
# main
def main():
numbers = []
print('How many numbers do you want to guess from?')
amount_of_numbers = int(input(' > '))
print('What is your number?')
player_number = int(input(' > '))
print('Let me guess your number.')
for i in range(amount_of_numbers):
numbe... | 542 | 0 | 23 |
ffb0a2715eeb5765567bddb65d9f9ddcb64b67a9 | 320 | py | Python | acmicpc/4344/4344.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 3 | 2019-03-09T05:19:23.000Z | 2019-04-06T09:26:36.000Z | acmicpc/4344/4344.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 1 | 2020-02-23T10:38:04.000Z | 2020-02-23T10:38:04.000Z | acmicpc/4344/4344.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 1 | 2019-05-22T13:47:53.000Z | 2019-05-22T13:47:53.000Z | N = int(input())
for i in range(N):
serial = list(map(int, input().split()))
get_proportion(serial)
| 24.615385 | 62 | 0.6 | N = int(input())
def get_proportion(x):
number = x[0]
average = (sum(x[1:]) / number)
upper = len([score for score in x[1:] if score > average])
proportion = upper / number * 100
print(f'{proportion:.3f}%')
for i in range(N):
serial = list(map(int, input().split()))
get_proportion(serial)
| 188 | 0 | 23 |
7543559330e0ad0bed405e4c8abadd74915a1bae | 2,914 | py | Python | agent/kraken/agent/kraken_pytest.py | fossabot/kraken-3 | 7ac472de8ff6f44aac4dbd231f896f00e6f3b278 | [
"Apache-2.0"
] | 66 | 2020-08-14T12:52:39.000Z | 2022-03-31T13:56:25.000Z | agent/kraken/agent/kraken_pytest.py | kinsanras/kraken | 3938ee4e65ba8f67ec5ee0e912b43fad84548f2c | [
"Apache-2.0"
] | 110 | 2020-07-23T07:12:09.000Z | 2022-03-26T05:54:18.000Z | agent/kraken/agent/kraken_pytest.py | kinsanras/kraken | 3938ee4e65ba8f67ec5ee0e912b43fad84548f2c | [
"Apache-2.0"
] | 4 | 2021-03-10T05:25:03.000Z | 2022-01-24T10:12:33.000Z | # Copyright 2020 The Kraken Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 27.752381 | 113 | 0.586136 | # Copyright 2020 The Kraken Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 2,103 | 0 | 46 |