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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
67c1f4ffaf915212bca4b400d8e95c751ada381f | 2,283 | py | Python | notepath/basics.py | hhfernald/notepath | 74f8fe118e58569a263a8f75e54a6c841c20a40a | [
"MIT"
] | null | null | null | notepath/basics.py | hhfernald/notepath | 74f8fe118e58569a263a8f75e54a6c841c20a40a | [
"MIT"
] | null | null | null | notepath/basics.py | hhfernald/notepath | 74f8fe118e58569a263a8f75e54a6c841c20a40a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# The function annotations in this module require Python 3.5 or higher.
import os
import textwrap
from itertools import chain
from typing import Dict, List, Union
# Type aliases
FilePath = str
NotePath = str
SQLSelectStatement = str
def sort_notepaths(notepaths: List[NotePath]) -> List[NoteP... | 34.590909 | 74 | 0.663163 | #!/usr/bin/env python3
# The function annotations in this module require Python 3.5 or higher.
import os
import textwrap
from itertools import chain
from typing import Dict, List, Union
# Type aliases
FilePath = str
NotePath = str
SQLSelectStatement = str
def get_data_path(filename: str) -> FilePath:
path = os... | 449 | 196 | 46 |
171f4ddfdd60faf26f187bb060d952f9328661c4 | 1,452 | py | Python | tests/test_spidermiddleware_urllength.py | FingerCrunch/scrapy | 3225de725720bba246ba8c9845fe4b84bc0c82e7 | [
"BSD-3-Clause"
] | 41,267 | 2015-01-01T07:39:25.000Z | 2022-03-31T20:09:40.000Z | tests/test_spidermiddleware_urllength.py | FingerCrunch/scrapy | 3225de725720bba246ba8c9845fe4b84bc0c82e7 | [
"BSD-3-Clause"
] | 4,420 | 2015-01-02T09:35:38.000Z | 2022-03-31T22:53:32.000Z | tests/test_spidermiddleware_urllength.py | FingerCrunch/scrapy | 3225de725720bba246ba8c9845fe4b84bc0c82e7 | [
"BSD-3-Clause"
] | 11,080 | 2015-01-01T18:11:30.000Z | 2022-03-31T15:33:19.000Z | from unittest import TestCase
from testfixtures import LogCapture
from scrapy.spidermiddlewares.urllength import UrlLengthMiddleware
from scrapy.http import Response, Request
from scrapy.spiders import Spider
from scrapy.utils.test import get_crawler
from scrapy.settings import Settings
| 34.571429 | 89 | 0.717631 | from unittest import TestCase
from testfixtures import LogCapture
from scrapy.spidermiddlewares.urllength import UrlLengthMiddleware
from scrapy.http import Response, Request
from scrapy.spiders import Spider
from scrapy.utils.test import get_crawler
from scrapy.settings import Settings
class TestUrlLengthMiddlewar... | 1,011 | 19 | 131 |
2d06b98fb7350ab1fec6bb7a3a4eb2742f918919 | 115 | py | Python | ex016.py | rodrigosilvanew/pythonexercicios-guanabara | de9de3109d6ff97d5f61ef41cb8e9db6de37a644 | [
"MIT"
] | null | null | null | ex016.py | rodrigosilvanew/pythonexercicios-guanabara | de9de3109d6ff97d5f61ef41cb8e9db6de37a644 | [
"MIT"
] | null | null | null | ex016.py | rodrigosilvanew/pythonexercicios-guanabara | de9de3109d6ff97d5f61ef41cb8e9db6de37a644 | [
"MIT"
] | null | null | null | from math import trunc
num = float(input('Digite um número: '))
print('A porção inteira é {}.'.format(trunc(num)))
| 28.75 | 50 | 0.695652 | from math import trunc
num = float(input('Digite um número: '))
print('A porção inteira é {}.'.format(trunc(num)))
| 0 | 0 | 0 |
7417f6843abb33ec34b71e7c8663f72b004814e0 | 77 | py | Python | part_map/pins/__init__.py | jdpatt/bga_color_map | e807d33c74ba7d5dad859a2488858be23fd2bc6c | [
"MIT"
] | 2 | 2019-08-06T12:34:59.000Z | 2020-03-05T04:42:40.000Z | part_map/pins/__init__.py | jdpatt/bga_color_map | e807d33c74ba7d5dad859a2488858be23fd2bc6c | [
"MIT"
] | 11 | 2018-04-07T16:58:46.000Z | 2020-03-08T00:43:42.000Z | part_map/pins/__init__.py | jdpatt/part_map | e807d33c74ba7d5dad859a2488858be23fd2bc6c | [
"MIT"
] | null | null | null | """Graphic Elements for the Pins."""
from .pin import Pin
__all__ = ["Pin"]
| 15.4 | 36 | 0.662338 | """Graphic Elements for the Pins."""
from .pin import Pin
__all__ = ["Pin"]
| 0 | 0 | 0 |
9aab70b6c3ec0dd1c6c2a38128907b13f8d2c637 | 542 | py | Python | 0374. Guess Number Higher or Lower.py | ehjhihlo/LeetCode-practice | e1391fd4a3a81956fa6a03ee89a3a67e539b4608 | [
"MIT"
] | null | null | null | 0374. Guess Number Higher or Lower.py | ehjhihlo/LeetCode-practice | e1391fd4a3a81956fa6a03ee89a3a67e539b4608 | [
"MIT"
] | null | null | null | 0374. Guess Number Higher or Lower.py | ehjhihlo/LeetCode-practice | e1391fd4a3a81956fa6a03ee89a3a67e539b4608 | [
"MIT"
] | null | null | null | # The guess API is already defined for you.
# @param num, your guess
# @return -1 if num is higher than the picked number
# 1 if num is lower than the picked number
# otherwise return 0
# def guess(num: int) -> int:
| 30.111111 | 52 | 0.509225 | # The guess API is already defined for you.
# @param num, your guess
# @return -1 if num is higher than the picked number
# 1 if num is lower than the picked number
# otherwise return 0
# def guess(num: int) -> int:
class Solution:
def guessNumber(self, n: int) -> int:
left, right = 1, n
... | 266 | -6 | 48 |
573326354d69c893d7e6738e04e0098f7e14a007 | 9,946 | py | Python | celseq2/qc.py | Puriney/celseq2 | 0e9629562a6685516e6330c3e2615a997c8771b7 | [
"BSD-3-Clause"
] | null | null | null | celseq2/qc.py | Puriney/celseq2 | 0e9629562a6685516e6330c3e2615a997c8771b7 | [
"BSD-3-Clause"
] | null | null | null | celseq2/qc.py | Puriney/celseq2 | 0e9629562a6685516e6330c3e2615a997c8771b7 | [
"BSD-3-Clause"
] | 1 | 2020-03-29T05:00:12.000Z | 2020-03-29T05:00:12.000Z | #!/usr/bin/env python3
import argparse
import numpy as np
import pandas as pd
from plotly import tools
import plotly.graph_objs as go
from plotly.offline import plot
from celseq2.helper import print_logger, base_name, is_nonempty_file
def plotly_qc(fpath, saveto, sep=',', name=''):
'''
Generate a plotly ht... | 34.178694 | 105 | 0.605268 | #!/usr/bin/env python3
import argparse
import numpy as np
import pandas as pd
from plotly import tools
import plotly.graph_objs as go
from plotly.offline import plot
from celseq2.helper import print_logger, base_name, is_nonempty_file
def plotly_scatter(x, y, mask_by=None, hover_text=None,
xlab=''... | 5,193 | 0 | 92 |
ab720888effdb06a63def2bf9bdc808387aadbdc | 1,231 | py | Python | crackutils.py | mhearne-usgs/handcrypt | fd4aa0f89258d9a01cbcdd53f9cd03e19e6367ee | [
"MIT"
] | 2 | 2017-09-28T18:30:49.000Z | 2021-04-23T22:39:26.000Z | crackutils.py | mhearne-usgs/handcrypt | fd4aa0f89258d9a01cbcdd53f9cd03e19e6367ee | [
"MIT"
] | null | null | null | crackutils.py | mhearne-usgs/handcrypt | fd4aa0f89258d9a01cbcdd53f9cd03e19e6367ee | [
"MIT"
] | 1 | 2015-10-20T07:45:22.000Z | 2015-10-20T07:45:22.000Z | #!/usr/bin/env python
from operator import itemgetter
| 23.673077 | 75 | 0.506093 | #!/usr/bin/env python
from operator import itemgetter
def unique(inlist, keepstr=True):
typ = type(inlist)
if not typ == list:
inlist = list(inlist)
i = 0
while i < len(inlist):
try:
del inlist[inlist.index(inlist[i], i + 1)]
except:
i += 1
if not typ in (str, unicode):
inlist = ... | 1,088 | 0 | 69 |
0c1699fca650650c6fe9d778a8add812cb37331c | 1,763 | py | Python | google/dialogflow-python-client-master/examples/send_user_entities_example.py | sergioalberto/Chatbots | b0a1dc15771d834fca491a809047dd347fe8a0a3 | [
"Apache-2.0"
] | 1 | 2019-03-31T23:25:46.000Z | 2019-03-31T23:25:46.000Z | google/dialogflow-python-client-master/examples/send_user_entities_example.py | sergioalberto/Chatbots | b0a1dc15771d834fca491a809047dd347fe8a0a3 | [
"Apache-2.0"
] | null | null | null | google/dialogflow-python-client-master/examples/send_user_entities_example.py | sergioalberto/Chatbots | b0a1dc15771d834fca491a809047dd347fe8a0a3 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf8 -*-
# !/usr/bin/env python
# Copyright 2017 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... | 26.313433 | 78 | 0.695406 | # -*- coding:utf8 -*-
# !/usr/bin/env python
# Copyright 2017 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... | 811 | 0 | 23 |
40b964448415f608cae54c386242e8dc6ee16f70 | 3,402 | py | Python | test/positive_tests/test_buy_ticket.py | PetrovAndrii/training | 4273ffd688b58af5c277a84fc8c57ad4ff0add04 | [
"Apache-2.0"
] | null | null | null | test/positive_tests/test_buy_ticket.py | PetrovAndrii/training | 4273ffd688b58af5c277a84fc8c57ad4ff0add04 | [
"Apache-2.0"
] | null | null | null | test/positive_tests/test_buy_ticket.py | PetrovAndrii/training | 4273ffd688b58af5c277a84fc8c57ad4ff0add04 | [
"Apache-2.0"
] | null | null | null |
from model.group_stations import Stations
# app.group.pay(email_pay="uz.all.test@gmail.com")
# app.group.pay(email_pay="uz.all.test@gmail.com")
| 38.659091 | 99 | 0.719871 |
from model.group_stations import Stations
def test_buy_ticket_full(app, data_groups):
stations = data_groups
app.session.login(username="uz.all.test@gmail.com", password="P@ssw0rd")
app.group.search_train(stations)
app.group.choice_train()
app.group.choice_types()
app.group.choice_wagon()... | 3,229 | 0 | 138 |
54d981108147f9841374f25cc59fc6d8a3108345 | 32,715 | py | Python | robosuite/utils/mjcf_utils.py | spatric5/robosuite | 9e6b9691eb949fbf33a23fbe8a8c6faea61c50b6 | [
"MIT"
] | 397 | 2020-09-28T02:49:58.000Z | 2022-03-30T18:08:19.000Z | robosuite/utils/mjcf_utils.py | spatric5/robosuite | 9e6b9691eb949fbf33a23fbe8a8c6faea61c50b6 | [
"MIT"
] | 169 | 2020-09-28T02:17:59.000Z | 2022-03-29T13:32:43.000Z | robosuite/utils/mjcf_utils.py | spatric5/robosuite | 9e6b9691eb949fbf33a23fbe8a8c6faea61c50b6 | [
"MIT"
] | 131 | 2020-09-28T14:50:35.000Z | 2022-03-31T02:27:33.000Z | # utility functions for manipulating MJCF XML models
import xml.etree.ElementTree as ET
import os
import numpy as np
from collections.abc import Iterable
from PIL import Image
from pathlib import Path
from copy import deepcopy
import robosuite
RED = [1, 0, 0, 1]
GREEN = [0, 1, 0, 1]
BLUE = [0, 0, 1, 1]
CYAN = [0, 1,... | 37.733564 | 119 | 0.63937 | # utility functions for manipulating MJCF XML models
import xml.etree.ElementTree as ET
import os
import numpy as np
from collections.abc import Iterable
from PIL import Image
from pathlib import Path
from copy import deepcopy
import robosuite
RED = [1, 0, 0, 1]
GREEN = [0, 1, 0, 1]
BLUE = [0, 0, 1, 1]
CYAN = [0, 1,... | 2,650 | 0 | 27 |
85879afa082ac336a1468ccfe1d39567d2b51921 | 3,247 | py | Python | app/sample_data.py | mazx4960/Notes-WebApp | 80725ce38a19a34e3818971073eae961280d26b3 | [
"MIT"
] | null | null | null | app/sample_data.py | mazx4960/Notes-WebApp | 80725ce38a19a34e3818971073eae961280d26b3 | [
"MIT"
] | 2 | 2020-06-23T15:26:32.000Z | 2021-06-02T00:16:55.000Z | app/sample_data.py | mazx4960/Notes-WebApp | 80725ce38a19a34e3818971073eae961280d26b3 | [
"MIT"
] | null | null | null | """
Notes Web App
Copyright (C) 2019 DesmondTan
"""
###########
# Imports #
###########
from app.models import User, Followers, Notes, Folders, Notes_Permissions, Notes_tag, Tags
from datetime import datetime
from werkzeug.security import generate_password_hash
#############
# Functions #
#############
| 20.814103 | 90 | 0.544503 | """
Notes Web App
Copyright (C) 2019 DesmondTan
"""
###########
# Imports #
###########
from app.models import User, Followers, Notes, Folders, Notes_Permissions, Notes_tag, Tags
from datetime import datetime
from werkzeug.security import generate_password_hash
#############
# Functions #
#############
def add_s... | 2,889 | 0 | 46 |
cee4ac12fcbe7398028cdd86b9e6782f12248d51 | 1,229 | py | Python | DynamicNetworkEmbedding-master/src/utils/log.py | yanzihan1/Use-Dynamic-network-embedding-for-Social-Network-Aligment- | 9bec908d25fbe4c078b2f16e28530ef55f866e10 | [
"MIT"
] | 12 | 2020-06-02T10:41:36.000Z | 2022-03-30T12:18:03.000Z | DynamicNetworkEmbedding-master/src/utils/log.py | yanzihan1/Use-Dynamic-network-embedding-for-Social-Network-Aligment- | 9bec908d25fbe4c078b2f16e28530ef55f866e10 | [
"MIT"
] | null | null | null | DynamicNetworkEmbedding-master/src/utils/log.py | yanzihan1/Use-Dynamic-network-embedding-for-Social-Network-Aligment- | 9bec908d25fbe4c078b2f16e28530ef55f866e10 | [
"MIT"
] | 1 | 2020-10-16T07:43:24.000Z | 2020-10-16T07:43:24.000Z | import logging
| 27.931818 | 76 | 0.557364 | import logging
def get_logger(log_filename=None, module_name=__name__, level=logging.INFO):
# select handler
if log_filename is None:
handler = logging.StreamHandler()
elif type(log_filename) is str:
handler = logging.FileHandler(log_filename, 'w')
else:
raise ValueError("log_f... | 1,168 | 0 | 46 |
1f214a235766454fd87a125aac936d0dadc566e3 | 1,383 | py | Python | src/teams/urls.py | GMNaim/Online-Project-Tracking-System | d727c6033c4abbacb5288179ee6ae5889a7a83a9 | [
"MIT"
] | null | null | null | src/teams/urls.py | GMNaim/Online-Project-Tracking-System | d727c6033c4abbacb5288179ee6ae5889a7a83a9 | [
"MIT"
] | null | null | null | src/teams/urls.py | GMNaim/Online-Project-Tracking-System | d727c6033c4abbacb5288179ee6ae5889a7a83a9 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
""" IF YOU CHANGE URL MUST CHANGE IN LIST PAGES"""
urlpatterns = [
path('list', views.team_list, name="team-list"),
path('add', views.team_add, name="team-add"),
path('update/<str:team_name>', views.team_update, name="team-update"),
# if you change url ... | 46.1 | 93 | 0.691974 | from django.urls import path
from . import views
""" IF YOU CHANGE URL MUST CHANGE IN LIST PAGES"""
urlpatterns = [
path('list', views.team_list, name="team-list"),
path('add', views.team_add, name="team-add"),
path('update/<str:team_name>', views.team_update, name="team-update"),
# if you change url ... | 0 | 0 | 0 |
7c42c8549db70d7e257f5776679da7df6555ffda | 17,132 | py | Python | amoeba_net/model_builder_slice.py | fanshiqing/DAPPLE | b2d2ceda90f6033b316f672ec05f45123234f130 | [
"BSD-3-Clause"
] | 50 | 2020-02-02T09:24:44.000Z | 2022-03-01T03:22:19.000Z | amoeba_net/model_builder_slice.py | fanshiqing/DAPPLE | b2d2ceda90f6033b316f672ec05f45123234f130 | [
"BSD-3-Clause"
] | 1 | 2020-02-04T03:50:02.000Z | 2020-02-04T04:41:37.000Z | amoeba_net/model_builder_slice.py | AlibabaPAI/DAPPLE | fd75dcfbc6c73a7624b9fd9d8c3334e5d04bcd20 | [
"BSD-3-Clause"
] | 9 | 2020-02-02T09:23:31.000Z | 2021-09-22T07:24:34.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.760181 | 95 | 0.664721 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 4,758 | 0 | 92 |
eb12f14d9fd886bbd07a6d505af2afba2e430e22 | 52 | py | Python | leonardo_package_index/models/__init__.py | leonardo-modules/leonardo-package-index | ed4dd006055fe99d841ce09776507a2cd31c2b83 | [
"BSD-3-Clause"
] | null | null | null | leonardo_package_index/models/__init__.py | leonardo-modules/leonardo-package-index | ed4dd006055fe99d841ce09776507a2cd31c2b83 | [
"BSD-3-Clause"
] | 11 | 2015-08-28T23:00:15.000Z | 2016-09-17T19:31:00.000Z | leonardo_package_index/models/__init__.py | leonardo-modules/leonardo-package-index | ed4dd006055fe99d841ce09776507a2cd31c2b83 | [
"BSD-3-Clause"
] | null | null | null |
from .base import BaseModel
from .package import *
| 13 | 27 | 0.769231 |
from .base import BaseModel
from .package import *
| 0 | 0 | 0 |
d0f85aaec88bf5aaf186031cca1f414a962cf27f | 1,907 | py | Python | frontend/app/auth/views.py | Leparwa/idea_pitching_app | 645fa2e11887dd2f5d62d4cfec18da68f5e4eb52 | [
"MIT"
] | null | null | null | frontend/app/auth/views.py | Leparwa/idea_pitching_app | 645fa2e11887dd2f5d62d4cfec18da68f5e4eb52 | [
"MIT"
] | null | null | null | frontend/app/auth/views.py | Leparwa/idea_pitching_app | 645fa2e11887dd2f5d62d4cfec18da68f5e4eb52 | [
"MIT"
] | null | null | null |
from flask import render_template,redirect,url_for, flash,request, session
from .forms import RegistrationForm, LoginForm
from flask_login import login_user, logout_user, login_required
from ..models import User
from .. import db
from app import login_manager
from . import auth
# login route
@auth.route('/login',... | 31.783333 | 105 | 0.705296 |
from flask import render_template,redirect,url_for, flash,request, session
from .forms import RegistrationForm, LoginForm
from flask_login import login_user, logout_user, login_required
from ..models import User
from .. import db
from app import login_manager
from . import auth
# login route
@auth.route('/login',... | 988 | 0 | 66 |
5ff4ee43792c2be33143e998473c52d1768590fc | 14,028 | py | Python | grouping/regression_grouping.py | fwmeng88/B3DB | 26f9c759dc6ec2963e61a74211577d0feb0007a3 | [
"CC0-1.0"
] | 13 | 2021-11-08T17:49:10.000Z | 2022-03-23T06:01:10.000Z | grouping/regression_grouping.py | fwmeng88/B3DB | 26f9c759dc6ec2963e61a74211577d0feb0007a3 | [
"CC0-1.0"
] | 3 | 2021-08-19T20:37:12.000Z | 2022-01-22T16:47:26.000Z | grouping/regression_grouping.py | fwmeng88/B3DB | 26f9c759dc6ec2963e61a74211577d0feb0007a3 | [
"CC0-1.0"
] | 11 | 2021-08-18T22:13:08.000Z | 2022-03-28T22:22:44.000Z | import pandas as pd
import numpy as np
from rdkit import Chem
from scipy import stats
import pubchempy as pcp
df = pd.read_excel("../2_bbb_all_complete_CID_out_smiles_fixed_updated.xlsx")
df = df[~df["logBB"].isna()]
df["logBB"] = df["logBB"].astype(float)
# remove molecules with logBB <= -9
df = df[df["logBB"] > -9... | 43.565217 | 138 | 0.565868 | import pandas as pd
import numpy as np
from rdkit import Chem
from scipy import stats
import pubchempy as pcp
df = pd.read_excel("../2_bbb_all_complete_CID_out_smiles_fixed_updated.xlsx")
df = df[~df["logBB"].isna()]
df["logBB"] = df["logBB"].astype(float)
# remove molecules with logBB <= -9
df = df[df["logBB"] > -9... | 231 | 0 | 23 |
5579a3e7bea5de190a86ff1cad7a2ff029a8b9cc | 99,346 | py | Python | app/application.py | codelableidenvelux/agestudy | 8bc688c99f48e8b4c7acd4300c52bd705c1ac3c7 | [
"MIT"
] | 1 | 2020-06-11T07:33:02.000Z | 2020-06-11T07:33:02.000Z | app/application.py | codelableidenvelux/agestudy | 8bc688c99f48e8b4c7acd4300c52bd705c1ac3c7 | [
"MIT"
] | 17 | 2020-03-17T19:55:47.000Z | 2020-03-23T16:59:39.000Z | app/application.py | codelableidenvelux/agestudy | 8bc688c99f48e8b4c7acd4300c52bd705c1ac3c7 | [
"MIT"
] | 1 | 2020-06-11T07:33:09.000Z | 2020-06-11T07:33:09.000Z | from flask import Flask, redirect, render_template, request, session, flash, jsonify,url_for, Response
from flask_session import Session
from tempfile import mkdtemp
from db.postgresql import Db
from werkzeug.security import check_password_hash, generate_password_hash
from werkzeug.utils import secure_filename
fr... | 49.697849 | 641 | 0.622944 | from flask import Flask, redirect, render_template, request, session, flash, jsonify,url_for, Response
from flask_session import Session
from tempfile import mkdtemp
from db.postgresql import Db
from werkzeug.security import check_password_hash, generate_password_hash
from werkzeug.utils import secure_filename
fr... | 45,614 | 10 | 1,001 |
960660456fd6d635e92d223aa55f6e6be63a677b | 137 | py | Python | basics/mod_divmod.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | 1 | 2019-04-07T23:14:29.000Z | 2019-04-07T23:14:29.000Z | basics/mod_divmod.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | basics/mod_divmod.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | first = int(input())
second = int(input())
mod = str(divmod(first,second))
print(str(first//second))
print(str(first%second))
print(mod) | 19.571429 | 31 | 0.70073 | first = int(input())
second = int(input())
mod = str(divmod(first,second))
print(str(first//second))
print(str(first%second))
print(mod) | 0 | 0 | 0 |
c1d84bbc8e41f5315159a2dec797b6d626a980bd | 1,531 | py | Python | src/scripts/collapseFeaturesAllSamples.py | bmennis/nb_prediction | 46938178c9ec3f4a82cf57a972d6a94303bfa802 | [
"RSA-MD"
] | null | null | null | src/scripts/collapseFeaturesAllSamples.py | bmennis/nb_prediction | 46938178c9ec3f4a82cf57a972d6a94303bfa802 | [
"RSA-MD"
] | null | null | null | src/scripts/collapseFeaturesAllSamples.py | bmennis/nb_prediction | 46938178c9ec3f4a82cf57a972d6a94303bfa802 | [
"RSA-MD"
] | null | null | null | """Mk one feature matrix for sample and chrom.
Use for all samples (not training).
"""
###Adjusting const import was import sfConst, but trying just include: const.py
include: "const.py"
import argparse, csv, sys, os, pandas
from functools import reduce
PWD = os.getcwd().split('code')[0]
sys.path.append(PWD + 'code/... | 35.604651 | 103 | 0.648596 | """Mk one feature matrix for sample and chrom.
Use for all samples (not training).
"""
###Adjusting const import was import sfConst, but trying just include: const.py
include: "const.py"
import argparse, csv, sys, os, pandas
from functools import reduce
PWD = os.getcwd().split('code')[0]
sys.path.append(PWD + 'code/... | 782 | 0 | 27 |
7bc19117ca6e77c0ff6d0d483903febf6fc725e2 | 421 | py | Python | django_telethon_authorization/exceptions.py | alifanov/django-telethon-authorization | 1c2864d3f29ab1dc53aa161a204b14b5ac0b35c5 | [
"BSD-3-Clause"
] | 9 | 2018-11-22T10:55:51.000Z | 2021-04-10T07:01:13.000Z | django_telethon_authorization/exceptions.py | alifanov/django-telethon-authorization | 1c2864d3f29ab1dc53aa161a204b14b5ac0b35c5 | [
"BSD-3-Clause"
] | 1 | 2018-11-18T07:25:41.000Z | 2020-10-26T18:06:27.000Z | django_telethon_authorization/exceptions.py | alifanov/django-telethon-authorization | 1c2864d3f29ab1dc53aa161a204b14b5ac0b35c5 | [
"BSD-3-Clause"
] | 7 | 2019-03-21T10:11:01.000Z | 2021-11-09T20:17:57.000Z | from django.http import JsonResponse
class DTAException(Exception):
""" Base exception which could represent itself as a JSON response"""
| 22.157895 | 73 | 0.724466 | from django.http import JsonResponse
class DTAException(Exception):
""" Base exception which could represent itself as a JSON response"""
def __init__(self, message):
self.message = message
def to_response(self):
return JsonResponse({"success": False, "message": self.message})
class Pay... | 112 | 64 | 99 |
b04c26ad2bbb8a9044df88515d388af73901ddfa | 1,249 | py | Python | project/forms/reference.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/forms/reference.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/forms/reference.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from flask_babelex import lazy_gettext
from flask_wtf import FlaskForm
from wtforms import SelectField, SubmitField
from wtforms.validators import DataRequired
from project.forms.common import event_rating_choices
| 31.225 | 118 | 0.705364 | from flask_babelex import lazy_gettext
from flask_wtf import FlaskForm
from wtforms import SelectField, SubmitField
from wtforms.validators import DataRequired
from project.forms.common import event_rating_choices
class CreateEventReferenceForm(FlaskForm):
admin_unit_id = SelectField(
lazy_gettext("Organ... | 0 | 962 | 69 |
4cdd4b429c8ff9fc7d7b9f99a108dde49c1f0687 | 10,169 | py | Python | models/inference/inference.py | AlexYangLi/tf_CFO | f56a7276016f0fcc48ebd0cd32d4f095db4c341b | [
"MIT"
] | 33 | 2018-05-09T12:08:03.000Z | 2022-03-14T03:06:16.000Z | models/inference/inference.py | AlexYangLi/tf_CFO | f56a7276016f0fcc48ebd0cd32d4f095db4c341b | [
"MIT"
] | 2 | 2018-06-28T03:09:08.000Z | 2018-10-16T06:44:41.000Z | models/inference/inference.py | AlexYangLi/tf_CFO | f56a7276016f0fcc48ebd0cd32d4f095db4c341b | [
"MIT"
] | 9 | 2018-06-25T09:49:57.000Z | 2019-10-08T07:53:54.000Z | # -*- coding: utf-8 -*-
"""
@author: alexyang
@contact: alex.yang0326@gmail.com
@file: inference.py
@time: 2018/4/22 14:32
@desc:
"""
import os
import random
from argparse import ArgumentParser
import numpy as np
import pickle
import pandas as pd
from models import EntDect, RelNet, SubTransE, SubTypeVec
os.env... | 40.839357 | 119 | 0.623857 | # -*- coding: utf-8 -*-
"""
@author: alexyang
@contact: alex.yang0326@gmail.com
@file: inference.py
@time: 2018/4/22 14:32
@desc:
"""
import os
import random
from argparse import ArgumentParser
import numpy as np
import pickle
import pandas as pd
from models import EntDect, RelNet, SubTransE, SubTypeVec
os.env... | 4,736 | 0 | 161 |
40f87e2e26c6730ae4feae202381bee51719bd23 | 1,662 | py | Python | custom_components/ge_home/devices/sac.py | olds/ha_gehome | 5cb24deab64bcade45861da0497a84631845922c | [
"MIT"
] | 41 | 2021-08-02T02:15:54.000Z | 2022-03-30T11:11:42.000Z | custom_components/ge_home/devices/sac.py | olds/ha_gehome | 5cb24deab64bcade45861da0497a84631845922c | [
"MIT"
] | 46 | 2021-08-03T02:20:59.000Z | 2022-03-30T11:17:15.000Z | custom_components/ge_home/devices/sac.py | olds/ha_gehome | 5cb24deab64bcade45861da0497a84631845922c | [
"MIT"
] | 15 | 2021-08-31T00:21:33.000Z | 2022-03-30T12:53:21.000Z | import logging
from typing import List
from homeassistant.helpers.entity import Entity
from gehomesdk.erd import ErdCode, ErdApplianceType
from .base import ApplianceApi
from ..entities import GeSacClimate, GeSacTemperatureSensor, GeErdSensor, GeErdSwitch, ErdOnOffBoolConverter
_LOGGER = logging.getLogger(__name__)
... | 43.736842 | 216 | 0.746089 | import logging
from typing import List
from homeassistant.helpers.entity import Entity
from gehomesdk.erd import ErdCode, ErdApplianceType
from .base import ApplianceApi
from ..entities import GeSacClimate, GeSacTemperatureSensor, GeErdSensor, GeErdSwitch, ErdOnOffBoolConverter
_LOGGER = logging.getLogger(__name__)
... | 1,175 | 0 | 27 |
839f8c793afc8bdd31090321be1de4e654f6786d | 32,790 | py | Python | cup_project/data_exp/CUP_analysis_general_v4.py | MthBr/kg_embedding_for_medical_booking_data | 1a44ad1f51e9d39766ed93fcdf26ce4c757cc130 | [
"MIT"
] | null | null | null | cup_project/data_exp/CUP_analysis_general_v4.py | MthBr/kg_embedding_for_medical_booking_data | 1a44ad1f51e9d39766ed93fcdf26ce4c757cc130 | [
"MIT"
] | null | null | null | cup_project/data_exp/CUP_analysis_general_v4.py | MthBr/kg_embedding_for_medical_booking_data | 1a44ad1f51e9d39766ed93fcdf26ce4c757cc130 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 3 12:07:10 2019
Generates plots.
DOES NOT WORK! review input files!
@author: modal
"""
import pandas as pd
import numpy as np
import pickle
# Disable warnings in Anaconda
import warnings
warnings.filterwarnings('ignore')
# Matplotlib forms basis... | 46.118143 | 193 | 0.712687 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 3 12:07:10 2019
Generates plots.
DOES NOT WORK! review input files!
@author: modal
"""
import pandas as pd
import numpy as np
import pickle
# Disable warnings in Anaconda
import warnings
warnings.filterwarnings('ignore')
# Matplotlib forms basis... | 0 | 0 | 0 |
f331b8784da5aab635708047938becdd9d070905 | 852 | py | Python | docs/make_pdf.py | aemoser/PyWake | 889a2c10882195af21339e9bcf2ede0db9b58319 | [
"MIT"
] | 30 | 2019-03-18T14:10:27.000Z | 2022-03-13T17:39:04.000Z | docs/make_pdf.py | aemoser/PyWake | 889a2c10882195af21339e9bcf2ede0db9b58319 | [
"MIT"
] | 1 | 2020-11-12T06:13:00.000Z | 2020-11-12T06:43:26.000Z | docs/make_pdf.py | aemoser/PyWake | 889a2c10882195af21339e9bcf2ede0db9b58319 | [
"MIT"
] | 20 | 2019-01-11T14:45:13.000Z | 2021-12-13T19:55:29.000Z | from pathlib import Path
import os
if __name__ == '__main__':
import py_wake
docs_path = Path(py_wake.__file__).parents[1] / 'docs'
if os.path.isdir(docs_path / 'api'):
print("Switch to PDF mode")
for ext in ['*.rst', 'notebooks/*.ipynb']:
for f in docs_path.glob(ext):
... | 32.769231 | 66 | 0.561033 | from pathlib import Path
import os
def svg2eps(f, replace=lambda s: s.replace(".svg", ".eps")):
txt = replace(f.read_text(encoding='utf-8')).replace("\r", "")
with open(f, 'w', encoding='utf-8', newline='\n') as fid:
fid.write(txt)
if __name__ == '__main__':
import py_wake
docs_path = Path(p... | 191 | 0 | 23 |
d71e3a55eb3e80ac77b4af625f8e4391eb48c7c2 | 1,399 | py | Python | elements/python/10/5/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/10/5/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/10/5/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null |
def depth(n):
"""
depth computes the depth of node n.
"""
d = 0
while n is not None:
n = n.parent
d += 1
return d
def lca(a, b):
"""
Computes the least common ancestor of a and b.
"""
da = depth(a)
db = depth(b)
# ensure a is the closest to the root
... | 20.275362 | 64 | 0.435311 | class Node(object):
def __init__(self, v, p=None, l=None, r=None):
self.value = v
self.parent = p
self.left = l
if l is not None:
l.parent = self
self.right = r
if r is not None:
r.parent = self
def depth(n):
"""
depth computes the de... | 673 | -2 | 94 |
080b83b574e6a0c6f7ed469bfbcace3c32f43405 | 6,260 | py | Python | test/test_stream.py | lokkju/pystream-protobuf | 1ec1bab13bf85a871948e8b08ddd6d965f32ceec | [
"MIT"
] | null | null | null | test/test_stream.py | lokkju/pystream-protobuf | 1ec1bab13bf85a871948e8b08ddd6d965f32ceec | [
"MIT"
] | null | null | null | test/test_stream.py | lokkju/pystream-protobuf | 1ec1bab13bf85a871948e8b08ddd6d965f32ceec | [
"MIT"
] | null | null | null | # coding=utf-8
"""
test.test_stream
~~~~~~~~~~~~~~~~
Test stream.stream module.
:copyright: (c) 2016 by Ali Ghaffaari.
:license: MIT, see LICENSE for more details.
"""
import os
import gzip
import filecmp
from .context import stream
from . import vg_pb2
def read_alns1(fpath, **kwargs):
""... | 30.686275 | 79 | 0.661981 | # coding=utf-8
"""
test.test_stream
~~~~~~~~~~~~~~~~
Test stream.stream module.
:copyright: (c) 2016 by Ali Ghaffaari.
:license: MIT, see LICENSE for more details.
"""
import os
import gzip
import filecmp
from .context import stream
from . import vg_pb2
def read_alns1(fpath, **kwargs):
""... | 0 | 0 | 0 |
c3b06945f3732230ab44e3675bb20a7318b372f9 | 828 | py | Python | ir_sim/world/components/obstacles/obs_circle.py | bearswang/intelligent-robot-simulator | 2fe276a11684f91c917eae58f6de438c69fab9e6 | [
"MIT"
] | 1 | 2021-12-25T14:04:13.000Z | 2021-12-25T14:04:13.000Z | ir_sim/world/components/obstacles/obs_circle.py | bearswang/intelligent-robot-simulator | 2fe276a11684f91c917eae58f6de438c69fab9e6 | [
"MIT"
] | null | null | null | ir_sim/world/components/obstacles/obs_circle.py | bearswang/intelligent-robot-simulator | 2fe276a11684f91c917eae58f6de438c69fab9e6 | [
"MIT"
] | null | null | null | import numpy as np
from ir_sim.world import motion_omni
| 29.571429 | 129 | 0.607488 | import numpy as np
from ir_sim.world import motion_omni
class obs_circle:
def __init__(self, id=0, position=np.zeros((2, 1)), radius=0.2, velocity=np.zeros((2, 1)), velocity_max=2 * np.ones((2, 1)),
step_time=0.1, obs_model='static', **kwargs):
if isinstance(position, list):
posi... | 688 | -4 | 76 |
02e8f586c82377452061e82cfe3ea2b2e7901a27 | 413 | py | Python | Hematite/winauto.py | wakeupmh/pythonProjects | a0e5a3be27115b18d0cef5141741f584447dbd07 | [
"MIT"
] | 1 | 2019-05-14T13:03:20.000Z | 2019-05-14T13:03:20.000Z | Hematite/winauto.py | wakeupmh/pythonProjects | a0e5a3be27115b18d0cef5141741f584447dbd07 | [
"MIT"
] | null | null | null | Hematite/winauto.py | wakeupmh/pythonProjects | a0e5a3be27115b18d0cef5141741f584447dbd07 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from pywinauto import application
import time
app = application.Application()
app.start("Notepad.exe")
time.sleep(2)
app.Notepad.edit.type_keys("Este é um teste", with_spaces = True)
time.sleep(2)
app.Notepad.menu_select("Arquivo ->Salvar")
app.Salvar.edit.set_edit_text("pywinauto.txt")... | 27.533333 | 66 | 0.714286 | # -*- coding: utf-8 -*-
from pywinauto import application
import time
app = application.Application()
app.start("Notepad.exe")
time.sleep(2)
app.Notepad.edit.type_keys("Este é um teste", with_spaces = True)
time.sleep(2)
app.Notepad.menu_select("Arquivo ->Salvar")
app.Salvar.edit.set_edit_text("pywinauto.txt")... | 0 | 0 | 0 |
8e7ec043233c48e6b6aed25d5ab149ece4622dfe | 3,297 | py | Python | tests/ov/test_hdlc.py | ftheoleyre/openvisualizer | bddc584ca958ecc12315920de85075a8d0f68f46 | [
"BSD-3-Clause"
] | 6 | 2018-11-11T07:38:18.000Z | 2021-09-27T18:39:01.000Z | tests/ov/test_hdlc.py | ftheoleyre/openvisualizer | bddc584ca958ecc12315920de85075a8d0f68f46 | [
"BSD-3-Clause"
] | 15 | 2018-09-24T18:49:30.000Z | 2021-06-26T13:26:27.000Z | tests/ov/test_hdlc.py | ftheoleyre/openvisualizer | bddc584ca958ecc12315920de85075a8d0f68f46 | [
"BSD-3-Clause"
] | 17 | 2018-10-01T15:19:53.000Z | 2021-09-27T18:39:05.000Z | #!/usr/bin/env python2
import json
import logging
import logging.handlers
import random
import pytest
from openvisualizer.motehandler.moteprobe import openhdlc
# ============================ logging =========================================
from openvisualizer.utils import format_string_buf
LOGFILE_NAME = 'test_hd... | 30.527778 | 115 | 0.62572 | #!/usr/bin/env python2
import json
import logging
import logging.handlers
import random
import pytest
from openvisualizer.motehandler.moteprobe import openhdlc
# ============================ logging =========================================
from openvisualizer.utils import format_string_buf
LOGFILE_NAME = 'test_hd... | 1,759 | 0 | 91 |
984932cdad1139aa8f8f24baf09cca70fd4d1c46 | 511 | py | Python | website_monitor/api/migrations/0007_auto_20181104_1849.py | KappaLambda/website-monitor | 2823e36d8089723fb3cca4ba9284f4754dd3d2cf | [
"MIT"
] | null | null | null | website_monitor/api/migrations/0007_auto_20181104_1849.py | KappaLambda/website-monitor | 2823e36d8089723fb3cca4ba9284f4754dd3d2cf | [
"MIT"
] | null | null | null | website_monitor/api/migrations/0007_auto_20181104_1849.py | KappaLambda/website-monitor | 2823e36d8089723fb3cca4ba9284f4754dd3d2cf | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2018-11-04 18:49
from django.db import migrations, models
| 22.217391 | 53 | 0.587084 | # Generated by Django 2.1.2 on 2018-11-04 18:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0006_auto_20181104_1712'),
]
operations = [
migrations.AlterField(
model_name='checktaskjob',
name='is_delete... | 0 | 397 | 23 |
94d95762bf1b4ac6120e2d1ec429cb37d80cf852 | 2,000 | py | Python | python/akg/ops/math/abs.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | python/akg/ops/math/abs.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | python/akg/ops/math/abs.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 39.215686 | 122 | 0.6845 | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 0 | 0 | 0 |
1bddf3e1c5a94eb8e3c5fc65ce08d1f30c8c8f07 | 2,512 | py | Python | nets/CitationGraphs_node_classification/gin_net.py | sejunssi/benchmarking_gnns | 881c92850f5366f7f8ca008da375037a41936681 | [
"MIT"
] | 5 | 2021-07-13T14:16:22.000Z | 2022-03-07T10:41:21.000Z | nets/CitationGraphs_node_classification/gin_net.py | sejunssi/benchmarking_gnns | 881c92850f5366f7f8ca008da375037a41936681 | [
"MIT"
] | null | null | null | nets/CitationGraphs_node_classification/gin_net.py | sejunssi/benchmarking_gnns | 881c92850f5366f7f8ca008da375037a41936681 | [
"MIT"
] | 1 | 2021-07-26T03:59:48.000Z | 2021-07-26T03:59:48.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import dgl
from dgl.nn.pytorch.glob import SumPooling, AvgPooling, MaxPooling
"""
GIN: Graph Isomorphism Networks
HOW POWERFUL ARE GRAPH NEURAL NETWORKS? (Keyulu Xu, Weihua Hu, Jure Leskovec and Stefanie Jegelka, ICLR 2019)
https://arxiv.o... | 35.885714 | 113 | 0.583201 | import torch
import torch.nn as nn
import torch.nn.functional as F
import dgl
from dgl.nn.pytorch.glob import SumPooling, AvgPooling, MaxPooling
"""
GIN: Graph Isomorphism Networks
HOW POWERFUL ARE GRAPH NEURAL NETWORKS? (Keyulu Xu, Weihua Hu, Jure Leskovec and Stefanie Jegelka, ICLR 2019)
https://arxiv.o... | 1,980 | 3 | 124 |
3892661d22532b78ad47568293f2063e70ec2dc4 | 1,123 | py | Python | mogan/tests/unit/api/v1/test_node.py | GURUIFENG9139/rocky-mogan | 6008c1d12b00e70d2cc651f7bd5d47968fc3aec7 | [
"Apache-2.0"
] | null | null | null | mogan/tests/unit/api/v1/test_node.py | GURUIFENG9139/rocky-mogan | 6008c1d12b00e70d2cc651f7bd5d47968fc3aec7 | [
"Apache-2.0"
] | null | null | null | mogan/tests/unit/api/v1/test_node.py | GURUIFENG9139/rocky-mogan | 6008c1d12b00e70d2cc651f7bd5d47968fc3aec7 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 Fiberhome
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 36.225806 | 75 | 0.727516 | #
# Copyright 2018 Fiberhome
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 318 | 139 | 23 |
0e3a3367be6bc445357382bbf7802f56791189a0 | 240 | py | Python | Comprehensions/Exercises/02. words_lengths.py | geodimitrov/PythonAdvanced_SoftUni | 6d8b9c320732c0e8de559aa374e0a2417098ed5b | [
"MIT"
] | null | null | null | Comprehensions/Exercises/02. words_lengths.py | geodimitrov/PythonAdvanced_SoftUni | 6d8b9c320732c0e8de559aa374e0a2417098ed5b | [
"MIT"
] | null | null | null | Comprehensions/Exercises/02. words_lengths.py | geodimitrov/PythonAdvanced_SoftUni | 6d8b9c320732c0e8de559aa374e0a2417098ed5b | [
"MIT"
] | 1 | 2021-08-19T14:36:41.000Z | 2021-08-19T14:36:41.000Z |
words = input().split(", ")
words_lengths = {word: len(word) for word in words}
print_result(words_lengths) | 30 | 71 | 0.666667 | def print_result(collection):
result = [f"{key} -> {value}" for key, value in collection.items()]
print(*result, sep=", ")
words = input().split(", ")
words_lengths = {word: len(word) for word in words}
print_result(words_lengths) | 109 | 0 | 22 |
68f7fb81c2e27bc14cb596fba97315e0c3ce7574 | 2,161 | py | Python | algo/research/hier_spectrum_test.py | alexeyev/visartm | d19e193b3c084d7f355a45b966c8bb2ebb6fa366 | [
"BSD-3-Clause"
] | 1 | 2020-10-01T10:11:21.000Z | 2020-10-01T10:11:21.000Z | algo/research/hier_spectrum_test.py | alexeyev/visartm | d19e193b3c084d7f355a45b966c8bb2ebb6fa366 | [
"BSD-3-Clause"
] | null | null | null | algo/research/hier_spectrum_test.py | alexeyev/visartm | d19e193b3c084d7f355a45b966c8bb2ebb6fa366 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import json
import algo.arranging.base as arr
import algo.arranging.metrics as metrics
model = research.model
if model.layers_count != 2:
raise ValueError("Ths research is only for 2-level hierarchical models!")
for metric in metrics.metrics_list:
research.report(... | 33.246154 | 78 | 0.663582 | # -*- coding: utf-8 -*-
import numpy as np
import json
import algo.arranging.base as arr
import algo.arranging.metrics as metrics
def put_vertical(ax, line, xs):
ymin, ymax = ax.get_ylim()
for x in xs:
ax.plot([x, x], [ymin, ymax], color="red")
model = research.model
if model.layers_count != 2:
... | 109 | 0 | 23 |
109753d3f4b62c64b1210cc9300c334476d2c073 | 1,790 | py | Python | cnn_visualization/backprop/vanilla.py | nkennek/pytorch-cnn-visualizations | 54699710b1beae1edae4bc12e9403080191c40ed | [
"MIT"
] | null | null | null | cnn_visualization/backprop/vanilla.py | nkennek/pytorch-cnn-visualizations | 54699710b1beae1edae4bc12e9403080191c40ed | [
"MIT"
] | null | null | null | cnn_visualization/backprop/vanilla.py | nkennek/pytorch-cnn-visualizations | 54699710b1beae1edae4bc12e9403080191c40ed | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from typing import Tuple
import numpy as np
import torch
import torch.nn as nn
from .base import BackProp
class VanillaBackprop(BackProp):
"""
Produces gradients generated with vanilla back propagation from the image
https://github.com/utkuozbulak/p... | 33.148148 | 101 | 0.624022 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from typing import Tuple
import numpy as np
import torch
import torch.nn as nn
from .base import BackProp
class VanillaBackprop(BackProp):
"""
Produces gradients generated with vanilla back propagation from the image
https://github.com/utkuozbulak/p... | 1,319 | 0 | 81 |
8479a794fa91df49946b4edcd708845cccea9fb5 | 1,157 | py | Python | segeval/data/tsv_test.py | cfournie/segmentation.evaluation | c4140b48112aac697aa7f05effe8026648ebc501 | [
"BSD-3-Clause"
] | 27 | 2015-03-22T23:06:47.000Z | 2022-01-21T23:21:05.000Z | segeval/data/tsv_test.py | cfournie/segmentation.evaluation | c4140b48112aac697aa7f05effe8026648ebc501 | [
"BSD-3-Clause"
] | 4 | 2015-03-12T18:27:08.000Z | 2019-10-24T13:09:31.000Z | segeval/data/tsv_test.py | cfournie/segmentation.evaluation | c4140b48112aac697aa7f05effe8026648ebc501 | [
"BSD-3-Clause"
] | 7 | 2015-03-12T18:29:27.000Z | 2019-01-25T08:52:05.000Z | '''
Tests the data merge functions and package.
.. moduleauthor:: Chris Fournier <chris.m.fournier@gmail.com>
'''
from __future__ import absolute_import
import unittest
import os
from segeval.data.tsv import (input_linear_mass_tsv, input_linear_positions_tsv)
from segeval.data.samples import HEARST_1997_STARGAZER
cl... | 30.447368 | 80 | 0.677615 | '''
Tests the data merge functions and package.
.. moduleauthor:: Chris Fournier <chris.m.fournier@gmail.com>
'''
from __future__ import absolute_import
import unittest
import os
from segeval.data.tsv import (input_linear_mass_tsv, input_linear_positions_tsv)
from segeval.data.samples import HEARST_1997_STARGAZER
cl... | 0 | 0 | 0 |
efd24ccc5104cfe9c59a90fbf66d029f177c85e4 | 2,394 | py | Python | thor/orbits/universal_propagate.py | moeyensj/thor | ec1150e23ec69944e45f6beddf57cfb46e9e44dc | [
"BSD-3-Clause"
] | 11 | 2019-08-22T18:37:09.000Z | 2022-02-28T22:49:25.000Z | thor/orbits/universal_propagate.py | moeyensj/thor | ec1150e23ec69944e45f6beddf57cfb46e9e44dc | [
"BSD-3-Clause"
] | 57 | 2019-08-20T19:57:14.000Z | 2021-09-16T20:54:59.000Z | thor/orbits/universal_propagate.py | moeyensj/thor | ec1150e23ec69944e45f6beddf57cfb46e9e44dc | [
"BSD-3-Clause"
] | 7 | 2021-02-09T21:28:43.000Z | 2022-02-01T08:55:29.000Z | import numpy as np
from numba import jit
from ..constants import Constants as c
from .lagrange import calcLagrangeCoeffs
from .lagrange import applyLagrangeCoeffs
__all__ = [
"propagateUniversal",
]
MU = c.MU
@jit(["f8[:,:](f8[:,:], f8[:], f8[:], f8, i8, f8)"], nopython=True, cache=True)
def propagateUniversal(... | 35.731343 | 111 | 0.622807 | import numpy as np
from numba import jit
from ..constants import Constants as c
from .lagrange import calcLagrangeCoeffs
from .lagrange import applyLagrangeCoeffs
__all__ = [
"propagateUniversal",
]
MU = c.MU
@jit(["f8[:,:](f8[:,:], f8[:], f8[:], f8, i8, f8)"], nopython=True, cache=True)
def propagateUniversal(... | 0 | 0 | 0 |
c239cc68cd998f503f51b0387a5d4d17e4ff3731 | 10,524 | py | Python | app/constants.py | PhtRaveller/covid19-ru | 04d7df2c1fc390767a9dc0836c47c8658544f848 | [
"MIT"
] | 9 | 2020-05-09T19:01:36.000Z | 2021-08-14T17:50:16.000Z | app/constants.py | PhtRaveller/covid19-ru | 04d7df2c1fc390767a9dc0836c47c8658544f848 | [
"MIT"
] | 5 | 2020-10-20T22:28:30.000Z | 2022-03-12T00:24:52.000Z | app/constants.py | PhtRaveller/covid19-ru | 04d7df2c1fc390767a9dc0836c47c8658544f848 | [
"MIT"
] | 3 | 2020-04-21T12:02:23.000Z | 2020-11-14T08:01:00.000Z | import pandas as pd
from bokeh.palettes import Reds
REGIONAL_LINKS = [{"name": "Россия", "link": "/"},
{"name": "Москва", "link": "/moscow"}]
# Categories
CATEGORIES = ["total", "died", "recovered", "swabs"]
CATEGORIES_STYLES = {
"total": {"color_class": "red-font", "text": "выявлено", "icon_cla... | 46.361233 | 147 | 0.464367 | import pandas as pd
from bokeh.palettes import Reds
REGIONAL_LINKS = [{"name": "Россия", "link": "/"},
{"name": "Москва", "link": "/moscow"}]
# Categories
CATEGORIES = ["total", "died", "recovered", "swabs"]
CATEGORIES_STYLES = {
"total": {"color_class": "red-font", "text": "выявлено", "icon_cla... | 0 | 0 | 0 |
432f455e0c201848f4cbfa24c443e77c975655d9 | 1,200 | py | Python | samples/demo_blob.py | SorenSeeberg/MrDatabase | 07d39c1f227d9ceaffe7e409f0915776901dd3e9 | [
"MIT"
] | null | null | null | samples/demo_blob.py | SorenSeeberg/MrDatabase | 07d39c1f227d9ceaffe7e409f0915776901dd3e9 | [
"MIT"
] | 1 | 2018-05-28T11:55:49.000Z | 2018-06-11T16:51:45.000Z | samples/demo_blob.py | SorenSeeberg/MrDatabase | 07d39c1f227d9ceaffe7e409f0915776901dd3e9 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
from mr_database import MrDatabase
from mr_database import LogLevel
""" import of table classes """
from samples.table_schema_examples import Image
db = MrDatabase(os.path.join(os.path.abspath(os.path.join(__file__, os.pardir)), 'test_functionality.db'))
if __n... | 26.086957 | 107 | 0.670833 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
from mr_database import MrDatabase
from mr_database import LogLevel
""" import of table classes """
from samples.table_schema_examples import Image
db = MrDatabase(os.path.join(os.path.abspath(os.path.join(__file__, os.pardir)), 'test_functionality.db'))
if __n... | 0 | 0 | 0 |
efb2f0812097a6277822fa2b23743bbd6ef18ca2 | 729 | py | Python | authors/serializers.py | CMPUT404-Organisation-Not-Found/SocialDistribution | c1c88af3086dac13c0da32094b5c843dbacae620 | [
"Apache-2.0"
] | null | null | null | authors/serializers.py | CMPUT404-Organisation-Not-Found/SocialDistribution | c1c88af3086dac13c0da32094b5c843dbacae620 | [
"Apache-2.0"
] | null | null | null | authors/serializers.py | CMPUT404-Organisation-Not-Found/SocialDistribution | c1c88af3086dac13c0da32094b5c843dbacae620 | [
"Apache-2.0"
] | 1 | 2022-03-21T22:14:36.000Z | 2022-03-21T22:14:36.000Z | from rest_framework.serializers import ModelSerializer
from rest_framework import serializers
from . import models
| 23.516129 | 71 | 0.650206 | from rest_framework.serializers import ModelSerializer
from rest_framework import serializers
from . import models
class AuthorSerializer(ModelSerializer):
class Meta:
model = models.Author
fields = ('type', 'id', "host", "displayName", "github", "url",
"profileImage")
... | 0 | 533 | 77 |
942d621eb544c0853fc0aa90efbbf484c71dd4e8 | 5,546 | py | Python | configy/config_container.py | grigi/configy | 86f6bdd3164f39e83e82e3527f5863032c0ed1e7 | [
"MIT"
] | 3 | 2015-09-18T13:06:04.000Z | 2021-08-10T16:37:21.000Z | configy/config_container.py | grigi/configy | 86f6bdd3164f39e83e82e3527f5863032c0ed1e7 | [
"MIT"
] | null | null | null | configy/config_container.py | grigi/configy | 86f6bdd3164f39e83e82e3527f5863032c0ed1e7 | [
"MIT"
] | null | null | null | '''
Configy confguration container
'''
# pylint: disable=W0212,R0903
import os
import re
from copy import deepcopy
import yaml
class ConfigyError(Exception):
'''
Configy exception handler
'''
pass
env_pattern = re.compile(r".*?\${(.*?)}.*?")
yaml.add_implicit_resolver("!pathex", env_pattern)
yaml.ad... | 25.915888 | 85 | 0.59304 | '''
Configy confguration container
'''
# pylint: disable=W0212,R0903
import os
import re
from copy import deepcopy
import yaml
class ConfigyError(Exception):
'''
Configy exception handler
'''
pass
env_pattern = re.compile(r".*?\${(.*?)}.*?")
def env_constructor(loader, node):
value = loader.const... | 854 | 0 | 211 |
8a0345dea65d0b7389eb1d62be7c613cb67f6af0 | 16,109 | py | Python | hungry_geese/training/alphagoose/alphagoose_trainer.py | IsaiahPressman/Kaggle_Hungry_Geese | f4d9fcb0811704bd339ad5c7ff937dd0d9e25763 | [
"MIT"
] | null | null | null | hungry_geese/training/alphagoose/alphagoose_trainer.py | IsaiahPressman/Kaggle_Hungry_Geese | f4d9fcb0811704bd339ad5c7ff937dd0d9e25763 | [
"MIT"
] | null | null | null | hungry_geese/training/alphagoose/alphagoose_trainer.py | IsaiahPressman/Kaggle_Hungry_Geese | f4d9fcb0811704bd339ad5c7ff937dd0d9e25763 | [
"MIT"
] | null | null | null | import base64
from filelock import FileLock
from kaggle_environments import make
import numpy as np
import os
from pathlib import Path
import pickle
import time
import torch
import torch.nn.functional as F
from torch.cuda import amp
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWrit... | 48.667674 | 118 | 0.576448 | import base64
from filelock import FileLock
from kaggle_environments import make
import numpy as np
import os
from pathlib import Path
import pickle
import time
import torch
import torch.nn.functional as F
from torch.cuda import amp
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWrit... | 15,303 | 3 | 238 |
25cd18aaa0537d3a637927bcc5f99e69f75523f5 | 816 | py | Python | ngallery/api/images.py | manti-by/ngallery | e87340707d15f3f35ecf7cf761232dd5f40e1389 | [
"BSD-3-Clause"
] | null | null | null | ngallery/api/images.py | manti-by/ngallery | e87340707d15f3f35ecf7cf761232dd5f40e1389 | [
"BSD-3-Clause"
] | null | null | null | ngallery/api/images.py | manti-by/ngallery | e87340707d15f3f35ecf7cf761232dd5f40e1389 | [
"BSD-3-Clause"
] | null | null | null | from rest_framework import serializers
from rest_framework.renderers import JSONRenderer, TemplateHTMLRenderer
from rest_framework.response import Response
from rest_framework.views import APIView
from ngallery.images.models import Image
| 32.64 | 76 | 0.727941 | from rest_framework import serializers
from rest_framework.renderers import JSONRenderer, TemplateHTMLRenderer
from rest_framework.response import Response
from rest_framework.views import APIView
from ngallery.images.models import Image
class ImageSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
... | 254 | 275 | 46 |
c6ad8624696d0190ead25276f66b5efa1582e2f4 | 521 | py | Python | week_7/poll_2.py | assassinen/python_openedu | 50805715f99cdc84fe1dd5d7007a13e37668ab6f | [
"Apache-2.0"
] | null | null | null | week_7/poll_2.py | assassinen/python_openedu | 50805715f99cdc84fe1dd5d7007a13e37668ab6f | [
"Apache-2.0"
] | null | null | null | week_7/poll_2.py | assassinen/python_openedu | 50805715f99cdc84fe1dd5d7007a13e37668ab6f | [
"Apache-2.0"
] | null | null | null | __author__ = 'NovikovII'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
alist = [{'a':[1,2,3], 'b':(1,2,3), 'c':{'a':'List','b':'Data'}, 'd':3.14}]
print(alist)
json_list = json.dumps(alist)
print(json_list)
json_list = json.dumps(alist, separators=(',',':'))
print(json_list)
json_list = json.dumps(ali... | 21.708333 | 77 | 0.652591 | __author__ = 'NovikovII'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
alist = [{'a':[1,2,3], 'b':(1,2,3), 'c':{'a':'List','b':'Data'}, 'd':3.14}]
print(alist)
json_list = json.dumps(alist)
print(json_list)
json_list = json.dumps(alist, separators=(',',':'))
print(json_list)
json_list = json.dumps(ali... | 0 | 0 | 0 |
08d8a5d0524128378cdc99aefe0f9699ed07e24e | 1,805 | py | Python | pycon/sponsorship/migrations/0006_migrate_web_description_and_logo.py | azkarmoulana/pycon | 931388e6f640c35b892bb4b2d12581ba7ec8cf4e | [
"BSD-3-Clause"
] | 154 | 2015-01-17T02:29:24.000Z | 2022-03-20T20:37:24.000Z | pycon/sponsorship/migrations/0006_migrate_web_description_and_logo.py | azkarmoulana/pycon | 931388e6f640c35b892bb4b2d12581ba7ec8cf4e | [
"BSD-3-Clause"
] | 316 | 2015-01-10T04:01:50.000Z | 2020-09-30T20:18:08.000Z | pycon/sponsorship/migrations/0006_migrate_web_description_and_logo.py | azkarmoulana/pycon | 931388e6f640c35b892bb4b2d12581ba7ec8cf4e | [
"BSD-3-Clause"
] | 89 | 2015-01-10T05:25:21.000Z | 2022-02-27T03:28:59.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
| 30.59322 | 98 | 0.652632 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def forward(apps, schema_editor):
Sponsor = apps.get_model('sponsorship', 'Sponsor')
db_alias = schema_editor.connection.alias
for sponsor in Sponsor.objects.using(db_alias):
# Get web description an... | 1,467 | 168 | 69 |
62a634f1ebd2c9240d2d364c5f2c754cc1efd9e0 | 3,386 | py | Python | scripts/icdloadergenerator.py | dkurt/OpenCL-ICD-Loader | b0fabd845b0e0d619f49e8fffb01a46c9aaa4c17 | [
"Apache-2.0"
] | null | null | null | scripts/icdloadergenerator.py | dkurt/OpenCL-ICD-Loader | b0fabd845b0e0d619f49e8fffb01a46c9aaa4c17 | [
"Apache-2.0"
] | null | null | null | scripts/icdloadergenerator.py | dkurt/OpenCL-ICD-Loader | b0fabd845b0e0d619f49e8fffb01a46c9aaa4c17 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
"""
* Copyright (c) 2019, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, co... | 43.974026 | 112 | 0.688128 | #! /usr/bin/env python3
"""
* Copyright (c) 2019, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, co... | 1,903 | 5 | 153 |
d5491e0e81296d38f30360a40f4f0b3198f09b70 | 7,787 | py | Python | metagrok/showdown/client.py | yuzeh/metagrok | 27f71441653611de939f1fe43e7aee6a7cdf1981 | [
"MIT"
] | 21 | 2019-06-21T05:00:40.000Z | 2021-01-26T02:07:58.000Z | metagrok/showdown/client.py | yuzeh/metagrok | 27f71441653611de939f1fe43e7aee6a7cdf1981 | [
"MIT"
] | 2 | 2019-07-12T00:36:00.000Z | 2020-02-27T10:20:57.000Z | metagrok/showdown/client.py | yuzeh/metagrok | 27f71441653611de939f1fe43e7aee6a7cdf1981 | [
"MIT"
] | 4 | 2019-10-07T18:22:11.000Z | 2021-11-02T10:04:21.000Z | import collections
import json
import logging
import gevent.queue
import requests
from metagrok import utils
from metagrok.showdown import actor
from metagrok.showdown.room import BattleRoom
from metagrok.showdown.battle_queue import BattleQueue
from metagrok.showdown.connection import ShowdownConnection
class Clien... | 31.023904 | 94 | 0.65314 | import collections
import json
import logging
import gevent.queue
import requests
from metagrok import utils
from metagrok.showdown import actor
from metagrok.showdown.room import BattleRoom
from metagrok.showdown.battle_queue import BattleQueue
from metagrok.showdown.connection import ShowdownConnection
class Clien... | 5,881 | 0 | 440 |
9f2a74ad1d32d8e216df5364199592a139cb58a9 | 732 | py | Python | autograde/cli/patch.py | wanLo/autograde | 165160a040868a1d3319066520f8a5623b623506 | [
"MIT"
] | null | null | null | autograde/cli/patch.py | wanLo/autograde | 165160a040868a1d3319066520f8a5623b623506 | [
"MIT"
] | null | null | null | autograde/cli/patch.py | wanLo/autograde | 165160a040868a1d3319066520f8a5623b623506 | [
"MIT"
] | null | null | null | from pathlib import Path
from autograde.cli.util import namespace_args, find_archives, traverse_archives
from autograde.util import logger
@namespace_args
def cmd_patch(patch: str, result: str, **_) -> int:
"""Patch result archive(s) with results from a different run"""
patch = Path(patch)
result = Path(... | 30.5 | 94 | 0.698087 | from pathlib import Path
from autograde.cli.util import namespace_args, find_archives, traverse_archives
from autograde.util import logger
@namespace_args
def cmd_patch(patch: str, result: str, **_) -> int:
"""Patch result archive(s) with results from a different run"""
patch = Path(patch)
result = Path(... | 0 | 0 | 0 |
6b31b9cd8a6934a31bda6088fd3fdeca737b6370 | 81 | py | Python | py/python.py | Founder001/TestSSM | ccc46286356ddef9b5c5d59e426f78061800b507 | [
"MIT"
] | 2 | 2018-02-11T06:49:43.000Z | 2018-02-11T06:55:36.000Z | py/python.py | Founder001/TestSSM | ccc46286356ddef9b5c5d59e426f78061800b507 | [
"MIT"
] | null | null | null | py/python.py | Founder001/TestSSM | ccc46286356ddef9b5c5d59e426f78061800b507 | [
"MIT"
] | 4 | 2018-02-11T06:57:12.000Z | 2018-02-11T10:12:41.000Z | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
_author_ = 'lilu'
print('hello')
| 11.571429 | 22 | 0.592593 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
_author_ = 'lilu'
print('hello')
| 0 | 0 | 0 |
0754ac143e7e1a63eef91113fab178e4ef057dd9 | 11,073 | py | Python | src/data/vehicles.py | enric1994/dr4oc | bf61929ab14fcdbbb784df05d97154a89a6eca10 | [
"MIT"
] | 1 | 2022-02-26T12:45:30.000Z | 2022-02-26T12:45:30.000Z | src/data/vehicles.py | enric1994/dr4oc | bf61929ab14fcdbbb784df05d97154a89a6eca10 | [
"MIT"
] | null | null | null | src/data/vehicles.py | enric1994/dr4oc | bf61929ab14fcdbbb784df05d97154a89a6eca10 | [
"MIT"
] | 1 | 2022-02-26T12:45:32.000Z | 2022-02-26T12:45:32.000Z | import random
import math
from sklearn.datasets import make_blobs
from src.data.utils.places_utils import get_random_image
from src.data.utils.lowpoly_utils import get_random_lowpoly_vehicle
MIN_LIGHTS = 5
MAX_LIGHTS = 8
LIGHT_ENERGY_MIN = 0.4
LIGHT_ENERGY_MAX = 1
LIGHT_POSITION_VAR = 3
LIGHT_CAST_SHADOWS = True
LIGH... | 58.898936 | 5,136 | 0.650592 | import random
import math
from sklearn.datasets import make_blobs
from src.data.utils.places_utils import get_random_image
from src.data.utils.lowpoly_utils import get_random_lowpoly_vehicle
MIN_LIGHTS = 5
MAX_LIGHTS = 8
LIGHT_ENERGY_MIN = 0.4
LIGHT_ENERGY_MAX = 1
LIGHT_POSITION_VAR = 3
LIGHT_CAST_SHADOWS = True
LIGH... | 4,746 | 0 | 23 |
bcc6a42c05f89e692fbefe32ef9c2371b465448e | 1,086 | py | Python | core/tests/add_user_clarus.py | manisharmagarg/qymatix | 0dc240970359429ae5105db79f9aebf1a99ba6fd | [
"Apache-2.0"
] | null | null | null | core/tests/add_user_clarus.py | manisharmagarg/qymatix | 0dc240970359429ae5105db79f9aebf1a99ba6fd | [
"Apache-2.0"
] | null | null | null | core/tests/add_user_clarus.py | manisharmagarg/qymatix | 0dc240970359429ae5105db79f9aebf1a99ba6fd | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth.models import User
from core.views.config_user import ConfigUser
user1 = {
'email': 'test@clarus-films.com',
'password': 'demo',
'first_name': "Clarus",
'last_name': "Films GmbH",
}
email = user1['email']
password = user1['password']
first_name = user1['first_name']
last_nam... | 25.255814 | 118 | 0.718232 | from django.contrib.auth.models import User
from core.views.config_user import ConfigUser
user1 = {
'email': 'test@clarus-films.com',
'password': 'demo',
'first_name': "Clarus",
'last_name': "Films GmbH",
}
email = user1['email']
password = user1['password']
first_name = user1['first_name']
last_nam... | 0 | 0 | 0 |
8115bbf05b5af2e3f73f6616fc1a7d258963f170 | 560 | py | Python | fastflix/encoders/ffmpeg_hevc_nvenc/main.py | AwesomeGitHubRepos/FastFlix | 60adf2b68a13907ac17013cb621867b2b302c101 | [
"MIT"
] | null | null | null | fastflix/encoders/ffmpeg_hevc_nvenc/main.py | AwesomeGitHubRepos/FastFlix | 60adf2b68a13907ac17013cb621867b2b302c101 | [
"MIT"
] | null | null | null | fastflix/encoders/ffmpeg_hevc_nvenc/main.py | AwesomeGitHubRepos/FastFlix | 60adf2b68a13907ac17013cb621867b2b302c101 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Chris Griffith"
from pathlib import Path
import pkg_resources
name = "HEVC (NVENC)"
requires = "cuda-llvm"
video_extension = "mkv"
video_dimension_divisor = 1
icon = str(Path(pkg_resources.resource_filename(__name__, f"../../data/encoders/icon_nvenc.png")).... | 26.666667 | 108 | 0.785714 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Chris Griffith"
from pathlib import Path
import pkg_resources
name = "HEVC (NVENC)"
requires = "cuda-llvm"
video_extension = "mkv"
video_dimension_divisor = 1
icon = str(Path(pkg_resources.resource_filename(__name__, f"../../data/encoders/icon_nvenc.png")).... | 0 | 0 | 0 |
6db49345ea4cfb413e039c01398ef72a9f81b829 | 280 | py | Python | hack/arp/ip.py | MisterZhouZhou/pythonLearn | 8933c7a6d444d3d86a173984e6cf4c08dbf84039 | [
"Apache-2.0"
] | 1 | 2019-07-09T09:59:39.000Z | 2019-07-09T09:59:39.000Z | hack/arp/ip.py | MisterZhouZhou/pythonLearn | 8933c7a6d444d3d86a173984e6cf4c08dbf84039 | [
"Apache-2.0"
] | null | null | null | hack/arp/ip.py | MisterZhouZhou/pythonLearn | 8933c7a6d444d3d86a173984e6cf4c08dbf84039 | [
"Apache-2.0"
] | null | null | null | import socket,uuid
# 获取主机名
hostname = socket.gethostname()
#获取IP
ip = socket.gethostbyname(hostname)
# 获取Mac地址
print(hostname, ip, get_mac_address()) | 25.454545 | 56 | 0.696429 | import socket,uuid
# 获取主机名
hostname = socket.gethostname()
#获取IP
ip = socket.gethostbyname(hostname)
# 获取Mac地址
def get_mac_address():
mac=uuid.UUID(int = uuid.getnode()).hex[-12:]
return ":".join([mac[e:e+2] for e in range(0,11,2)])
print(hostname, ip, get_mac_address()) | 108 | 0 | 22 |
0ecae2b9be1eaa5175289bb1d96a334c01e938e5 | 8,188 | py | Python | fedlearner/common/metrics.py | piiswrong/fedlearner | 8875d30cfeb40d149a26faa5056f9fa6e96b3fac | [
"Apache-2.0"
] | 5 | 2020-04-14T06:37:45.000Z | 2021-04-26T15:58:01.000Z | fedlearner/common/metrics.py | piiswrong/fedlearner | 8875d30cfeb40d149a26faa5056f9fa6e96b3fac | [
"Apache-2.0"
] | 1 | 2020-04-27T03:01:27.000Z | 2020-04-27T03:01:27.000Z | fedlearner/common/metrics.py | piiswrong/fedlearner | 8875d30cfeb40d149a26faa5056f9fa6e96b3fac | [
"Apache-2.0"
] | 13 | 2020-02-20T05:56:52.000Z | 2020-06-08T07:11:25.000Z | # Copyright 2020 The FedLearner Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.149798 | 80 | 0.593063 | # Copyright 2020 The FedLearner Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 4,839 | 1,036 | 275 |
001b0a27287fd30407da25f57d66c3620a999b02 | 3,306 | py | Python | Bruno/admin.py | brunoalmeidamartins/ryu | ffb1a3d6e04e2446cfde5275c2df9624e53e924a | [
"Apache-2.0"
] | null | null | null | Bruno/admin.py | brunoalmeidamartins/ryu | ffb1a3d6e04e2446cfde5275c2df9624e53e924a | [
"Apache-2.0"
] | null | null | null | Bruno/admin.py | brunoalmeidamartins/ryu | ffb1a3d6e04e2446cfde5275c2df9624e53e924a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#Aplicacao de administracao de classes de servicos - Versao 7.0
#Manipula uma lista de objetos Classe
import os
from classe import Classe
import pickle
path_home = os.getenv("HOME") #Captura o caminho da pasta HOME
path_home = '/home/bruno'
filename=path_home+'/ryu/Bruno/classes.conf' #Nome do arqu... | 27.55 | 137 | 0.69873 | #!/usr/bin/python
#Aplicacao de administracao de classes de servicos - Versao 7.0
#Manipula uma lista de objetos Classe
import os
from classe import Classe
import pickle
path_home = os.getenv("HOME") #Captura o caminho da pasta HOME
path_home = '/home/bruno'
filename=path_home+'/ryu/Bruno/classes.conf' #Nome do arqu... | 1,287 | 0 | 138 |
7ee002035af97c3fd9e9ad40aec4fe2d6e7d0f42 | 1,263 | py | Python | pre_commit_hooks/loaderon_hooks/util/template_methods/checker_template_method.py | alvaroscelza/pre-commit-hooks | fc9a7a376dc733a1e3cc00b5ed35936bcb3c3b3b | [
"MIT"
] | null | null | null | pre_commit_hooks/loaderon_hooks/util/template_methods/checker_template_method.py | alvaroscelza/pre-commit-hooks | fc9a7a376dc733a1e3cc00b5ed35936bcb3c3b3b | [
"MIT"
] | null | null | null | pre_commit_hooks/loaderon_hooks/util/template_methods/checker_template_method.py | alvaroscelza/pre-commit-hooks | fc9a7a376dc733a1e3cc00b5ed35936bcb3c3b3b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import argparse
from abc import abstractmethod
from argparse import ArgumentTypeError
from pre_commit_hooks.loaderon_hooks.util.check_failed_exception import CheckFailedException
| 28.066667 | 92 | 0.661916 | # -*- coding: utf-8 -*-
import argparse
from abc import abstractmethod
from argparse import ArgumentTypeError
from pre_commit_hooks.loaderon_hooks.util.check_failed_exception import CheckFailedException
class CheckerTemplateMethod(object):
def __init__(self, argv):
self.parser = argparse.ArgumentParser()... | 613 | 422 | 23 |
b9afd0202ebfec040ff0f9b46370c978adb033cc | 638 | py | Python | models/multitask/config.py | nghuyong/mtl-duolingo | bd7c9bf1f3d54b23928ba3af2b460e5e34eb8375 | [
"MIT"
] | null | null | null | models/multitask/config.py | nghuyong/mtl-duolingo | bd7c9bf1f3d54b23928ba3af2b460e5e34eb8375 | [
"MIT"
] | null | null | null | models/multitask/config.py | nghuyong/mtl-duolingo | bd7c9bf1f3d54b23928ba3af2b460e5e34eb8375 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
from models.base.config import BaseConfig
| 21.266667 | 41 | 0.673981 | #!/usr/bin/env python
# encoding: utf-8
from models.base.config import BaseConfig
class MultiTaskConfig(BaseConfig):
batch_size = 128
lr = 1e-3
pos_weight = 0.7
# Meta Encoder
meta_embedding_dim = 150
user_related_MLP_layers = 1
exercise_related_MLP_layers = 1
# Context Encoder
co... | 0 | 533 | 23 |
f21ec9f03201e9aca6654932bfebcc74b5667fbb | 215 | py | Python | setup.py | glucometers-tech/freestyle-hid | 371f0df2f2c52442716d88760d97a2282c83ff95 | [
"Apache-2.0",
"MIT"
] | 3 | 2021-06-16T03:42:57.000Z | 2021-11-01T07:01:50.000Z | setup.py | Flameeyes/freestyle-hid | b231c996a62dd179ff4daf50ed20976c327cf845 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-10-04T15:11:00.000Z | 2020-10-04T15:11:39.000Z | setup.py | Flameeyes/freestyle-hid | b231c996a62dd179ff4daf50ed20976c327cf845 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-10-04T18:55:34.000Z | 2020-10-04T18:55:34.000Z | # -*- coding: utf-8 -*-
#
# SPDX-FileCopyrightText: © 2013 The freestyle-hid Authors
# SPDX-License-Identifier: 0BSD
# Ensure it's present.
import setuptools_scm # noqa: F401
from setuptools import setup
setup()
| 19.545455 | 58 | 0.725581 | # -*- coding: utf-8 -*-
#
# SPDX-FileCopyrightText: © 2013 The freestyle-hid Authors
# SPDX-License-Identifier: 0BSD
# Ensure it's present.
import setuptools_scm # noqa: F401
from setuptools import setup
setup()
| 0 | 0 | 0 |
5bbef959ae904be5340df2e020cf84d93764a6c0 | 763 | py | Python | src_smp/s_curve.py | Thijs3/Anomaly-Detection-with-RS-Quadtree | 7389ba7c8359c22f7a00c4e0a1bc03534b0666b5 | [
"MIT"
] | null | null | null | src_smp/s_curve.py | Thijs3/Anomaly-Detection-with-RS-Quadtree | 7389ba7c8359c22f7a00c4e0a1bc03534b0666b5 | [
"MIT"
] | null | null | null | src_smp/s_curve.py | Thijs3/Anomaly-Detection-with-RS-Quadtree | 7389ba7c8359c22f7a00c4e0a1bc03534b0666b5 | [
"MIT"
] | null | null | null | print(__doc__)
from collections import OrderedDict
from functools import partial
from time import time
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.ticker import NullFormatter
from sklearn import manifold, datasets
# Next line to silence pyflakes. This import is needed.
Axe... | 25.433333 | 68 | 0.74574 | print(__doc__)
from collections import OrderedDict
from functools import partial
from time import time
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.ticker import NullFormatter
from sklearn import manifold, datasets
# Next line to silence pyflakes. This import is needed.
Axe... | 0 | 0 | 0 |
8007bbe259e1edb27d3ab5c180862e33c2be7c41 | 2,166 | py | Python | util/remove_alt_splicing_from_gff.py | MayroseLab/Panoramic | 9e1ef68ab863e8127da6f40cb68d2c06f11b9d61 | [
"MIT"
] | 2 | 2021-12-15T03:13:36.000Z | 2022-02-20T12:14:37.000Z | util/remove_alt_splicing_from_gff.py | MayroseLab/Panoramic | 9e1ef68ab863e8127da6f40cb68d2c06f11b9d61 | [
"MIT"
] | 12 | 2020-07-18T14:02:50.000Z | 2021-02-08T16:12:44.000Z | util/remove_alt_splicing_from_gff.py | MayroseLab/Panoramic | 9e1ef68ab863e8127da6f40cb68d2c06f11b9d61 | [
"MIT"
] | 1 | 2021-09-23T10:51:15.000Z | 2021-09-23T10:51:15.000Z | """
Takes a gff file and for genes with
multiple mRNAs, only keeps the longest
(largest sum of exon lengths). Prints
out a new gff.
If a proteins fasta is also provided,
removes genes shorter than a given
cutoff
"""
from __future__ import print_function
import gffutils
import sys
from os import remove
from time import... | 32.328358 | 105 | 0.698061 | """
Takes a gff file and for genes with
multiple mRNAs, only keeps the longest
(largest sum of exon lengths). Prints
out a new gff.
If a proteins fasta is also provided,
removes genes shorter than a given
cutoff
"""
from __future__ import print_function
import gffutils
import sys
from os import remove
from time import... | 0 | 0 | 0 |
83b97ccd04764c48f09c807d506e22454dd9c082 | 2,030 | py | Python | tests/task/keras/test_keras_util.py | UTokyo-ICEPP/multiml | 3dce96492c90bb2bc9c2d4ccfd66eb13d652a520 | [
"Apache-2.0"
] | 7 | 2021-04-16T03:05:25.000Z | 2021-12-17T06:04:13.000Z | tests/task/keras/test_keras_util.py | UTokyo-ICEPP/multiml | 3dce96492c90bb2bc9c2d4ccfd66eb13d652a520 | [
"Apache-2.0"
] | 6 | 2021-04-21T10:17:14.000Z | 2021-06-30T06:18:41.000Z | tests/task/keras/test_keras_util.py | UTokyo-ICEPP/multiml | 3dce96492c90bb2bc9c2d4ccfd66eb13d652a520 | [
"Apache-2.0"
] | 5 | 2021-04-15T06:38:04.000Z | 2021-09-05T14:30:05.000Z | import os
import numpy as np
import pytest
from multiml import logger
from multiml.saver import Saver
from multiml.task.keras.modules import MLPBlock
if __name__ == '__main__':
test_keras_util()
| 31.71875 | 94 | 0.625123 | import os
import numpy as np
import pytest
from multiml import logger
from multiml.saver import Saver
from multiml.task.keras.modules import MLPBlock
def test_keras_util():
logger.set_level(logger.DEBUG)
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1'
saver = Saver()
model = MLPBlock(
layers=[2,... | 1,803 | 0 | 23 |
fca5c85eda3331958af7047d575b615031d4694e | 451 | py | Python | pysyte/config/urator.py | git-wwts/pysyte | 625658138cdb5affc1a6a89a9f2c7e3667ee80c2 | [
"MIT"
] | 1 | 2021-11-10T15:24:36.000Z | 2021-11-10T15:24:36.000Z | pysyte/config/urator.py | git-wwts/pysyte | 625658138cdb5affc1a6a89a9f2c7e3667ee80c2 | [
"MIT"
] | 12 | 2020-01-15T00:19:41.000Z | 2021-05-11T14:52:04.000Z | pysyte/config/urator.py | git-wwts/pysyte | 625658138cdb5affc1a6a89a9f2c7e3667ee80c2 | [
"MIT"
] | 2 | 2015-01-31T11:51:06.000Z | 2015-01-31T21:29:19.000Z | """Handle config files"""
import yaml
from pysyte.types.dictionaries import NameSpaces
| 20.5 | 57 | 0.696231 | """Handle config files"""
import yaml
from pysyte.types.dictionaries import NameSpaces
class Config(NameSpaces):
def __init__(self, data):
super().__init__(data)
def load(path_to_config):
with path_to_config.open() as stream:
data = yaml.safe_load(stream)
return Config(data)
def ... | 260 | 4 | 95 |
22cb9eabb040f77e9d22bd85031f2ee0dd3a75c4 | 775 | py | Python | newsroom/migrations/0014_auto_20200720_1122.py | groundupnews/gu | c7179ee3d058c8749d250d681032a76dc8d599d5 | [
"BSD-3-Clause"
] | 19 | 2018-01-28T14:35:40.000Z | 2020-12-04T03:04:02.000Z | newsroom/migrations/0014_auto_20200720_1122.py | groundupnews/gu | c7179ee3d058c8749d250d681032a76dc8d599d5 | [
"BSD-3-Clause"
] | 8 | 2018-06-02T14:28:28.000Z | 2021-08-06T10:22:37.000Z | newsroom/migrations/0014_auto_20200720_1122.py | groundupnews/gu | c7179ee3d058c8749d250d681032a76dc8d599d5 | [
"BSD-3-Clause"
] | 21 | 2018-02-25T14:07:48.000Z | 2020-05-28T23:10:52.000Z | # Generated by Django 2.2.12 on 2020-07-20 09:22
from django.db import migrations, models
| 40.789474 | 433 | 0.68129 | # Generated by Django 2.2.12 on 2020-07-20 09:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('newsroom', '0013_auto_20200506_2255'),
]
operations = [
migrations.AlterField(
model_name='article',
name='copyrigh... | 0 | 660 | 23 |
df32d57760510f6b0887b4e5d44563934fc3759b | 13,697 | py | Python | gcn_main.py | onomcanbot/VPS_GCN | a999cdffffd80f0292dbc0c5b2c7fbc24a62ac12 | [
"MIT"
] | null | null | null | gcn_main.py | onomcanbot/VPS_GCN | a999cdffffd80f0292dbc0c5b2c7fbc24a62ac12 | [
"MIT"
] | null | null | null | gcn_main.py | onomcanbot/VPS_GCN | a999cdffffd80f0292dbc0c5b2c7fbc24a62ac12 | [
"MIT"
] | null | null | null | import os
import argparse
import math
import time
import numpy as np
from tqdm import trange
from tqdm import tqdm
from modules.dataset import KittiDataset, euler_from_quaternion
from modules.load_dataset import *
from modules.box import box_encoding, box_decoding
from modules.model_gcn import *
from mod... | 33.903465 | 155 | 0.584508 | import os
import argparse
import math
import time
import numpy as np
from tqdm import trange
from tqdm import tqdm
from modules.dataset import KittiDataset, euler_from_quaternion
from modules.load_dataset import *
from modules.box import box_encoding, box_decoding
from modules.model_gcn import *
from mod... | 9,154 | 0 | 75 |
6f1310b92290604cd78ac0f7ce1ba60798c8597e | 80 | py | Python | Aula07/ex00.py | danicon/Curso_Python | 18fb4aad975bdc3b96cb5320331dbc7d3c3a459d | [
"MIT"
] | null | null | null | Aula07/ex00.py | danicon/Curso_Python | 18fb4aad975bdc3b96cb5320331dbc7d3c3a459d | [
"MIT"
] | null | null | null | Aula07/ex00.py | danicon/Curso_Python | 18fb4aad975bdc3b96cb5320331dbc7d3c3a459d | [
"MIT"
] | null | null | null | nome = input('Qual é o seu nome? ')
print(f'Prazer em te conhecer {nome:=^20}!') | 40 | 44 | 0.65 | nome = input('Qual é o seu nome? ')
print(f'Prazer em te conhecer {nome:=^20}!') | 0 | 0 | 0 |
bd3d2a14035956f153f9020df8734586de802927 | 1,190 | py | Python | utils_ml/src/classification_comparator/classification_comparator.py | RodSernaPerez/utils_ml | 72251447f5c33f3873c746e98f532ce19a5b6003 | [
"MIT"
] | null | null | null | utils_ml/src/classification_comparator/classification_comparator.py | RodSernaPerez/utils_ml | 72251447f5c33f3873c746e98f532ce19a5b6003 | [
"MIT"
] | null | null | null | utils_ml/src/classification_comparator/classification_comparator.py | RodSernaPerez/utils_ml | 72251447f5c33f3873c746e98f532ce19a5b6003 | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.ensemble import RandomForestRegressor
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import f1_score, accuracy_score
from sklearn.model_selection import train_test_split
class ClassificationComparator:
'''
Performs simple test to check and compare seve... | 38.387097 | 99 | 0.668067 | import numpy as np
from sklearn.ensemble import RandomForestRegressor
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import f1_score, accuracy_score
from sklearn.model_selection import train_test_split
class ClassificationComparator:
'''
Performs simple test to check and compare seve... | 777 | 0 | 54 |
36ad338550bf23823bfa666520274cd14c703c1c | 691 | py | Python | setup.py | luxiaohan/pysixdesk | 8430dfac707ccbc2a505b11add35d809484c3e9d | [
"MIT"
] | null | null | null | setup.py | luxiaohan/pysixdesk | 8430dfac707ccbc2a505b11add35d809484c3e9d | [
"MIT"
] | null | null | null | setup.py | luxiaohan/pysixdesk | 8430dfac707ccbc2a505b11add35d809484c3e9d | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pysixdesk",
version="0.0.1",
author='Xiaohan Lu,A. Mereghetti',
author_email='luxh@ihep.ac.cn,Alessio.Mereghetti@cern.ch',
description="A python interface to manage and control the workflo... | 31.409091 | 89 | 0.681621 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pysixdesk",
version="0.0.1",
author='Xiaohan Lu,A. Mereghetti',
author_email='luxh@ihep.ac.cn,Alessio.Mereghetti@cern.ch',
description="A python interface to manage and control the workflo... | 0 | 0 | 0 |
36d04491476caf8aed0553c4c8fd5511d0acfbd5 | 2,298 | py | Python | gateway/src/main_bk.py | bother3000/Smart-IoT-Planting-System | 7c33f150850fb8c9bc250fa02bf306f02f7cafb8 | [
"MIT"
] | 171 | 2017-09-22T08:25:18.000Z | 2022-02-28T07:56:41.000Z | gateway/src/main_bk.py | bother3000/Smart-IoT-Planting-System | 7c33f150850fb8c9bc250fa02bf306f02f7cafb8 | [
"MIT"
] | 2 | 2018-06-28T02:33:04.000Z | 2021-06-09T06:56:58.000Z | gateway/src/main_bk.py | bother3000/Smart-IoT-Planting-System | 7c33f150850fb8c9bc250fa02bf306f02f7cafb8 | [
"MIT"
] | 108 | 2017-10-03T20:11:52.000Z | 2022-03-19T15:21:48.000Z | #!/usr/bin/env python
#Communicate with end devices via LoRa.
#Communicate with server via MQTT(hbmqtt) and HTTP POST.
#Save data in the sqlite database.
#Parse JSON from MQTT and LoRa protocol.
#Communication module: LoRa.
#Communication method with device via LoRa.
#Uart port drive LoRa module.
#Parse JSON between d... | 36.47619 | 95 | 0.58007 | #!/usr/bin/env python
#Communicate with end devices via LoRa.
#Communicate with server via MQTT(hbmqtt) and HTTP POST.
#Save data in the sqlite database.
#Parse JSON from MQTT and LoRa protocol.
#Communication module: LoRa.
#Communication method with device via LoRa.
#Uart port drive LoRa module.
#Parse JSON between d... | 1,259 | 0 | 22 |
6a3e60c55d38b047f32ff4dc41ae418637e1c143 | 1,948 | py | Python | scripts/undistort.py | xloem/xivo | a7dd2553aed28adeee6b6f4c69feb9ba760f12f2 | [
"BSD-4-Clause-UC"
] | 662 | 2019-09-01T02:16:59.000Z | 2022-03-29T19:24:07.000Z | scripts/undistort.py | xloem/xivo | a7dd2553aed28adeee6b6f4c69feb9ba760f12f2 | [
"BSD-4-Clause-UC"
] | 38 | 2019-09-05T05:02:20.000Z | 2022-03-30T02:59:49.000Z | scripts/undistort.py | xloem/xivo | a7dd2553aed28adeee6b6f4c69feb9ba760f12f2 | [
"BSD-4-Clause-UC"
] | 104 | 2019-09-01T07:41:58.000Z | 2022-03-27T16:24:54.000Z | import argparse, os, json
import numpy as np
import matplotlib.pyplot as plt
import cv2
parser = argparse.ArgumentParser()
parser.add_argument('log', help='log file dumped by pyxivo to process')
parser.add_argument('out_dir', help='output directory to save undistorted images')
parser.add_argument('-debug', action='st... | 31.934426 | 121 | 0.645791 | import argparse, os, json
import numpy as np
import matplotlib.pyplot as plt
import cv2
parser = argparse.ArgumentParser()
parser.add_argument('log', help='log file dumped by pyxivo to process')
parser.add_argument('out_dir', help='output directory to save undistorted images')
parser.add_argument('-debug', action='st... | 623 | 0 | 23 |
5e34313fbcfc9f1b5fae9e1758091b71132ab596 | 7,239 | py | Python | smarthome/state.py | andvikt/mqtt_decorator | 36bf76d3d6fa548172db32cdf002d68c96c7a535 | [
"BSD-2-Clause"
] | null | null | null | smarthome/state.py | andvikt/mqtt_decorator | 36bf76d3d6fa548172db32cdf002d68c96c7a535 | [
"BSD-2-Clause"
] | null | null | null | smarthome/state.py | andvikt/mqtt_decorator | 36bf76d3d6fa548172db32cdf002d68c96c7a535 | [
"BSD-2-Clause"
] | null | null | null | import asyncio
from dataclasses import dataclass, field
from typing import Generic, Callable, Union
from .const import _T, logger, _ThingT, Logger
import typing
from asyncio_primitives import CustomCondition, utils as async_utils
from .utils.proxy import LambdaProxy
logger = logger.getChild('states')
@dataclass(eq=... | 41.603448 | 128 | 0.615278 | import asyncio
from dataclasses import dataclass, field
from typing import Generic, Callable, Union
from .const import _T, logger, _ThingT, Logger
import typing
from asyncio_primitives import CustomCondition, utils as async_utils
from .utils.proxy import LambdaProxy
logger = logger.getChild('states')
@dataclass(eq=... | 4,124 | 0 | 493 |
61482fb23a6693fe4337bc4ec2c53a909d61030d | 1,664 | py | Python | Python/pycg/json_converter.py | longhorn396/code-golf | e279ab0f57594f37f461ad5066958c480787ff72 | [
"MIT"
] | null | null | null | Python/pycg/json_converter.py | longhorn396/code-golf | e279ab0f57594f37f461ad5066958c480787ff72 | [
"MIT"
] | null | null | null | Python/pycg/json_converter.py | longhorn396/code-golf | e279ab0f57594f37f461ad5066958c480787ff72 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Used to convert Python strings of JSON into human-readable JSON
Useful when building AWS Lambda functions"""
from ast import literal_eval
from .common import main
def py_to_js(obj_str):
"""Evaluate string and return readable result"""
return rprint(literal_eval(obj_str))
def rprint... | 32 | 96 | 0.549279 | #!/usr/bin/env python3
"""Used to convert Python strings of JSON into human-readable JSON
Useful when building AWS Lambda functions"""
from ast import literal_eval
from .common import main
def py_to_js(obj_str):
"""Evaluate string and return readable result"""
return rprint(literal_eval(obj_str))
def rprint... | 127 | 0 | 26 |
40f38a52391e6cd4af6243f80eb0dc3f7ea48dca | 5,892 | py | Python | Zhockon/python/structure.py | williamlagos/qt-coding | 0457a587116b9c4146c230964773a2de3d12d300 | [
"MIT"
] | null | null | null | Zhockon/python/structure.py | williamlagos/qt-coding | 0457a587116b9c4146c230964773a2de3d12d300 | [
"MIT"
] | null | null | null | Zhockon/python/structure.py | williamlagos/qt-coding | 0457a587116b9c4146c230964773a2de3d12d300 | [
"MIT"
] | null | null | null | #
# This file is part of Zhockon Platform project.
#
# Copyright (C) 2009-2011 William Oliveira de Lagos <william.lagos1@gmail.com>
#
# Zhockon is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | 36.596273 | 105 | 0.5426 | #
# This file is part of Zhockon Platform project.
#
# Copyright (C) 2009-2011 William Oliveira de Lagos <william.lagos1@gmail.com>
#
# Zhockon is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | 3,356 | -22 | 1,184 |
88a050ca07079f4e64ec1b43497ac429a894f239 | 2,987 | py | Python | util/eval_util.py | aogdrummond/sound_field_sim_neural_net | 23822829deda6e0607da896a0ed000162094be42 | [
"MIT"
] | null | null | null | util/eval_util.py | aogdrummond/sound_field_sim_neural_net | 23822829deda6e0607da896a0ed000162094be42 | [
"MIT"
] | null | null | null | util/eval_util.py | aogdrummond/sound_field_sim_neural_net | 23822829deda6e0607da896a0ed000162094be42 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
columns_names=["name","num_file","xDim","yDim","m2","num_mics","num_comb","freq","NMSE","SSIM","pattern","p_real","p_predicted","p_previous"]
| 30.171717 | 141 | 0.679946 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
columns_names=["name","num_file","xDim","yDim","m2","num_mics","num_comb","freq","NMSE","SSIM","pattern","p_real","p_predicted","p_previous"]
def preprocess_df(dataframe):
num_mics = np.unique(dataframe['num_mics'].values)
list_str_freq = n... | 2,703 | 0 | 69 |
43b634e3bc9bca4cf580437d891352ed332eddd5 | 3,300 | py | Python | tonclient/debot.py | move-ton/ton-client-py | a9393a0e03b5da9bf5369a44c6873a3e720af229 | [
"Apache-2.0"
] | 28 | 2020-10-29T06:57:32.000Z | 2022-03-20T12:26:14.000Z | tonclient/debot.py | move-ton/ton-client-py | a9393a0e03b5da9bf5369a44c6873a3e720af229 | [
"Apache-2.0"
] | 1 | 2021-03-30T18:18:17.000Z | 2021-04-04T15:35:10.000Z | tonclient/debot.py | move-ton/ton-client-py | a9393a0e03b5da9bf5369a44c6873a3e720af229 | [
"Apache-2.0"
] | 8 | 2020-10-28T20:11:52.000Z | 2022-01-12T12:28:02.000Z | from tonclient.decorators import result_as
from tonclient.module import TonModule
from tonclient.types import ParamsOfStart, RegisteredDebot, ParamsOfFetch, \
ParamsOfExecute, ParamsOfSend, ResponseHandler, ParamsOfInit, \
ResultOfFetch, ParamsOfRemove
class TonDebot(TonModule):
""" Free TON debot SDK API... | 35.869565 | 78 | 0.656061 | from tonclient.decorators import result_as
from tonclient.module import TonModule
from tonclient.types import ParamsOfStart, RegisteredDebot, ParamsOfFetch, \
ParamsOfExecute, ParamsOfSend, ResponseHandler, ParamsOfInit, \
ResultOfFetch, ParamsOfRemove
class TonDebot(TonModule):
""" Free TON debot SDK API... | 0 | 0 | 0 |
6331836b6583031e61b620fbaea6b77589749324 | 3,164 | py | Python | smart_selects/db_fields.py | zhangguiyu/django-smart-selects | 089c84e80ed6588620cca80ac8d5bbfadfb04889 | [
"BSD-3-Clause"
] | null | null | null | smart_selects/db_fields.py | zhangguiyu/django-smart-selects | 089c84e80ed6588620cca80ac8d5bbfadfb04889 | [
"BSD-3-Clause"
] | null | null | null | smart_selects/db_fields.py | zhangguiyu/django-smart-selects | 089c84e80ed6588620cca80ac8d5bbfadfb04889 | [
"BSD-3-Clause"
] | null | null | null | from django.db.models.fields.related import ForeignKey
try:
from south.modelsinspector import add_introspection_rules
has_south = True
except ImportError:
has_south = False
from smart_selects import form_fields
class ChainedForeignKey(ForeignKey):
"""
chains the choices of a previous combo box ... | 34.769231 | 97 | 0.621365 | from django.db.models.fields.related import ForeignKey
try:
from south.modelsinspector import add_introspection_rules
has_south = True
except ImportError:
has_south = False
from smart_selects import form_fields
class ChainedForeignKey(ForeignKey):
"""
chains the choices of a previous combo box ... | 2,273 | 0 | 106 |
9f241478dcc0ce7ad4168952723f332ab07015f4 | 344 | py | Python | campaign/migrations/0004_remove_campaignpage_donor.py | Aleccc/gtcrew | 7e6e7024afdbf48ee796cb1f9a86b913e6843dda | [
"MIT"
] | null | null | null | campaign/migrations/0004_remove_campaignpage_donor.py | Aleccc/gtcrew | 7e6e7024afdbf48ee796cb1f9a86b913e6843dda | [
"MIT"
] | 21 | 2019-02-14T02:47:34.000Z | 2022-01-23T02:22:54.000Z | campaign/migrations/0004_remove_campaignpage_donor.py | Aleccc/gtcrew | 7e6e7024afdbf48ee796cb1f9a86b913e6843dda | [
"MIT"
] | null | null | null | # Generated by Django 3.0.7 on 2020-06-13 22:22
from django.db import migrations
| 19.111111 | 58 | 0.610465 | # Generated by Django 3.0.7 on 2020-06-13 22:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('campaign', '0003_campaignpage_donateindexpage'),
]
operations = [
migrations.RemoveField(
model_name='campaignpage',
name='d... | 0 | 238 | 23 |
5793cd1aca875bed94166bb0441a408187b6039a | 3,570 | py | Python | cmdb-compliance/pocsuite/pocs/solr_8.3.1_rce.py | zjj1002/aws-cloud-cmdb-system | 47982007688e5db1272435891cb654ab11d0d60a | [
"Apache-2.0"
] | null | null | null | cmdb-compliance/pocsuite/pocs/solr_8.3.1_rce.py | zjj1002/aws-cloud-cmdb-system | 47982007688e5db1272435891cb654ab11d0d60a | [
"Apache-2.0"
] | 1 | 2022-01-04T13:53:16.000Z | 2022-01-04T13:53:16.000Z | cmdb-compliance/pocsuite/pocs/solr_8.3.1_rce.py | zjj1002/aws-cloud-cmdb-system | 47982007688e5db1272435891cb654ab11d0d60a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
from urllib.parse import urlparse
from pocsuite3.api import requests as req
from pocsuite3.api import register_poc
from pocsuite3.api import Output, POCBase
from pocsuite3.api import POC_CATEGORY, VUL_TYPE
import json
register_poc(TestPOC)
| 45.769231 | 454 | 0.601401 | #!/usr/bin/env python
# coding: utf-8
from urllib.parse import urlparse
from pocsuite3.api import requests as req
from pocsuite3.api import register_poc
from pocsuite3.api import Output, POCBase
from pocsuite3.api import POC_CATEGORY, VUL_TYPE
import json
class TestPOC(POCBase):
vulID = ''
version = '1'
a... | 2,653 | 812 | 23 |
8aba9fbf2780ef07add8c586ccad77d85ba6461e | 4,248 | py | Python | models.py | tobiasbartel/servicium-instance_manager | 74702ab61481df67c06c6dc7dfd435a4b37126e8 | [
"MIT"
] | null | null | null | models.py | tobiasbartel/servicium-instance_manager | 74702ab61481df67c06c6dc7dfd435a4b37126e8 | [
"MIT"
] | null | null | null | models.py | tobiasbartel/servicium-instance_manager | 74702ab61481df67c06c6dc7dfd435a4b37126e8 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.template.defaultfilters import slugify
from django.db import models
from django.core.validators import validate_comma_separated_integer_list
from django.db import models
from servicecatalog.models import STATE, LIVE, ACCESS_DIRECTION, BOTH, PaymentMethod, Module, Co... | 44.25 | 176 | 0.717279 | from __future__ import unicode_literals
from django.template.defaultfilters import slugify
from django.db import models
from django.core.validators import validate_comma_separated_integer_list
from django.db import models
from servicecatalog.models import STATE, LIVE, ACCESS_DIRECTION, BOTH, PaymentMethod, Module, Co... | 735 | 2,795 | 115 |
9dca130d8e3a1862f62432fa815d0aca8ddc0e4a | 13,258 | py | Python | pipeline/gen_clean_unique_dataset.py | czodrowskilab/Multiprotic-pKa-Processing | 787e071f225f283afd8411acd64c9b8092cabb47 | [
"MIT"
] | 9 | 2020-10-07T10:47:23.000Z | 2022-02-22T11:53:40.000Z | pipeline/gen_clean_unique_dataset.py | czodrowskilab/Multiprotic-pKa-Processing | 787e071f225f283afd8411acd64c9b8092cabb47 | [
"MIT"
] | null | null | null | pipeline/gen_clean_unique_dataset.py | czodrowskilab/Multiprotic-pKa-Processing | 787e071f225f283afd8411acd64c9b8092cabb47 | [
"MIT"
] | 1 | 2022-01-31T00:59:21.000Z | 2022-01-31T00:59:21.000Z | """
This script prepares SDF files which can then be used for machine learning.
This includes sanitizing, filtering molecules with bad functional groups and
unwanted elements, removing salts, filtering by Lipinski's rule of five and
unify different tautomers. OpenEye QUACPAC and ChemAxon Marvin are required.
"""
from ... | 26.947154 | 114 | 0.620757 | """
This script prepares SDF files which can then be used for machine learning.
This includes sanitizing, filtering molecules with bad functional groups and
unwanted elements, removing salts, filtering by Lipinski's rule of five and
unify different tautomers. OpenEye QUACPAC and ChemAxon Marvin are required.
"""
from ... | 0 | 0 | 0 |
1bde59e3512f139373576d473811d4630ce6a4d6 | 163 | py | Python | options/test_options.py | PrendiProgramming/UprightNet | 73a0677079e27a806b48bf9ede70b8377002b2f3 | [
"MIT"
] | 14 | 2021-04-02T20:42:55.000Z | 2021-07-27T14:43:09.000Z | options/test_options.py | PrendiProgramming/UprightNet | 73a0677079e27a806b48bf9ede70b8377002b2f3 | [
"MIT"
] | 1 | 2021-04-15T05:43:16.000Z | 2021-05-28T05:12:45.000Z | options/test_options.py | PrendiProgramming/UprightNet | 73a0677079e27a806b48bf9ede70b8377002b2f3 | [
"MIT"
] | 5 | 2021-04-03T00:13:20.000Z | 2022-03-28T08:57:41.000Z | from .base_options import BaseOptions
| 23.285714 | 37 | 0.723926 | from .base_options import BaseOptions
class TestOptions(BaseOptions):
def initialize(self):
BaseOptions.initialize(self)
self.isTrain = False
| 66 | 10 | 49 |
48b5da08153f318a7615fc11d4a9567ba8ae4750 | 2,897 | py | Python | pyCode/IUCN_modelmean_deltap50depthav.py | kallisons/CMIP5_p50 | ee8e078720d1a009cfb9355a9cadb07455b674ba | [
"MIT"
] | null | null | null | pyCode/IUCN_modelmean_deltap50depthav.py | kallisons/CMIP5_p50 | ee8e078720d1a009cfb9355a9cadb07455b674ba | [
"MIT"
] | null | null | null | pyCode/IUCN_modelmean_deltap50depthav.py | kallisons/CMIP5_p50 | ee8e078720d1a009cfb9355a9cadb07455b674ba | [
"MIT"
] | 2 | 2017-08-07T00:42:45.000Z | 2017-10-27T21:44:36.000Z | #ipython --pylab
import scipy
from mpl_toolkits.basemap import Basemap, addcyclic, shiftgrid
from netCDF4 import Dataset
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import pandas
import pylab
Folder = 'results'
species1 = ['Thunnus_obesus', 'Thunnus_albacares', 'Katsuwonus_pelamis... | 42.602941 | 135 | 0.674836 | #ipython --pylab
import scipy
from mpl_toolkits.basemap import Basemap, addcyclic, shiftgrid
from netCDF4 import Dataset
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import pandas
import pylab
Folder = 'results'
species1 = ['Thunnus_obesus', 'Thunnus_albacares', 'Katsuwonus_pelamis... | 0 | 0 | 0 |
55fc3f3d0b0b263b1268920b554408680cd21d63 | 1,506 | py | Python | app/tests/test_state.py | mike-wendt/unicorn-remote | e649c069482446f08b0baf579de05f065ad7ab89 | [
"MIT"
] | 37 | 2017-07-30T16:43:22.000Z | 2021-12-12T09:40:11.000Z | app/tests/test_state.py | kfechter/unicorn-remote | 39466cad9e7420b51ffa11fa7554756a934f2d24 | [
"MIT"
] | 7 | 2017-11-18T19:22:18.000Z | 2021-09-08T15:59:00.000Z | app/tests/test_state.py | kfechter/unicorn-remote | 39466cad9e7420b51ffa11fa7554756a934f2d24 | [
"MIT"
] | 8 | 2018-04-21T05:31:40.000Z | 2020-12-09T19:43:32.000Z | import unittest
import time
import app.programs.hd
import app.programs.original
from app.state import state, ProgramNotFound
| 30.12 | 71 | 0.664675 | import unittest
import time
import app.programs.hd
import app.programs.original
from app.state import state, ProgramNotFound
class TestState(unittest.TestCase):
def tearDown(self):
if state._process is not None:
state._process.terminate()
def start_all(self, list):
for name, _ i... | 1,099 | 14 | 266 |
cc82eabd4f2faa5d7e33d0fe9ddf3c80288da94e | 524 | py | Python | cfp/migrations/0015_applicant_company_name.py | WebCampZg/conference-web | 76ccae83924fdcd040d9280db5cf3a249d668606 | [
"BSD-3-Clause"
] | 4 | 2015-03-03T17:48:14.000Z | 2019-02-27T20:28:42.000Z | cfp/migrations/0015_applicant_company_name.py | WebCampZg/conference-web | 76ccae83924fdcd040d9280db5cf3a249d668606 | [
"BSD-3-Clause"
] | 104 | 2015-02-25T18:09:15.000Z | 2019-06-21T10:02:53.000Z | cfp/migrations/0015_applicant_company_name.py | WebCampZg/conference-web | 76ccae83924fdcd040d9280db5cf3a249d668606 | [
"BSD-3-Clause"
] | 9 | 2015-03-01T18:59:14.000Z | 2019-06-10T06:48:45.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-16 09:49
from __future__ import unicode_literals
from django.db import migrations, models
| 24.952381 | 120 | 0.637405 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-16 09:49
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cfp', '0014_auto_20170605_1545'),
]
operations = [
migrations.AddField(
... | 0 | 345 | 23 |
012a93c81ad512b403409306470bc0ae46c48bf1 | 3,528 | py | Python | Tensorflow/CAM-VGG.py | Qin-Folks/ADL | a6b8a90d1a6101fbd0a1591357a3b9b563f5c3ea | [
"MIT"
] | 3 | 2019-09-20T03:53:41.000Z | 2020-06-18T03:12:25.000Z | Tensorflow/CAM-VGG.py | truongthanhdat/ADL | 7cc7659693a2e84f4e4370e939604c77be712ca4 | [
"MIT"
] | null | null | null | Tensorflow/CAM-VGG.py | truongthanhdat/ADL | 7cc7659693a2e84f4e4370e939604c77be712ca4 | [
"MIT"
] | 1 | 2019-09-20T03:53:44.000Z | 2019-09-20T03:53:44.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# File: main.py
# This code is mainly borrowed
# from the official example codes of tensorpack library.
# https://github.com/ppwwyyxx/tensorpack/tree/master/examples
# Revised by Junsuk Choe <skykite@yonsei.ac.kr>
# Weakly Supervised Object Localization (WSOL) based on VG... | 31.221239 | 77 | 0.652494 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# File: main.py
# This code is mainly borrowed
# from the official example codes of tensorpack library.
# https://github.com/ppwwyyxx/tensorpack/tree/master/examples
# Revised by Junsuk Choe <skykite@yonsei.ac.kr>
# Weakly Supervised Object Localization (WSOL) based on VG... | 1,789 | 2 | 103 |
10969b118ad5fe1347fcb992b81dad5fe1e8d043 | 905 | py | Python | ncdc/gentfw.py | akrherz/radcomp | d44459f72891c6e1a92b61488e08422383b000d1 | [
"Apache-2.0"
] | 3 | 2015-04-18T22:23:27.000Z | 2016-05-12T11:24:32.000Z | ncdc/gentfw.py | akrherz/radcomp | d44459f72891c6e1a92b61488e08422383b000d1 | [
"Apache-2.0"
] | 4 | 2016-09-30T15:04:46.000Z | 2022-03-05T13:32:40.000Z | ncdc/gentfw.py | akrherz/radcomp | d44459f72891c6e1a92b61488e08422383b000d1 | [
"Apache-2.0"
] | 4 | 2015-04-18T22:23:57.000Z | 2017-05-07T15:23:37.000Z | import mx.DateTime, sys, pg, random
v = sys.argv[1]
ts = mx.DateTime.strptime(v, "%Y%m%d%H%M")
out = open("n0r%s.tfw" % (v,), "w")
out.write(
""" 0.0100000000000%s
0.00000
0.00000
-0.010000000000000%s
-126.000000
50.0000"""
% (v, random.randint(0, 1000))
)
out.close()
sys.exit(0)
mydb = pg.co... | 22.625 | 128 | 0.583425 | import mx.DateTime, sys, pg, random
v = sys.argv[1]
ts = mx.DateTime.strptime(v, "%Y%m%d%H%M")
out = open("n0r%s.tfw" % (v,), "w")
out.write(
""" 0.0100000000000%s
0.00000
0.00000
-0.010000000000000%s
-126.000000
50.0000"""
% (v, random.randint(0, 1000))
)
out.close()
sys.exit(0)
mydb = pg.co... | 0 | 0 | 0 |
9bec0eb08f208b160fca6a51cbbdb851c8c9d036 | 2,460 | py | Python | servertools/weather/yrno.py | barretobrock/server-tools | 2f2b899994df90817686b2232d3d65e53defd8c2 | [
"MIT"
] | null | null | null | servertools/weather/yrno.py | barretobrock/server-tools | 2f2b899994df90817686b2232d3d65e53defd8c2 | [
"MIT"
] | null | null | null | servertools/weather/yrno.py | barretobrock/server-tools | 2f2b899994df90817686b2232d3d65e53defd8c2 | [
"MIT"
] | null | null | null | import pandas as pd
from yr.libyr import Yr
class YRNOLocation:
"""Locations for YRNO"""
ATX = 'USA/Texas/Austin'
TLL = 'Estonia/Harjumaa/Tallinn'
RKV = 'Estonia/Lääne-Virumaa/Rakvere'
class YrNoWeather:
"""Pulls weather data using Yr.no weather API"""
def __init__(self, location: str, timez... | 40.327869 | 94 | 0.604065 | import pandas as pd
from yr.libyr import Yr
class YRNOLocation:
"""Locations for YRNO"""
ATX = 'USA/Texas/Austin'
TLL = 'Estonia/Harjumaa/Tallinn'
RKV = 'Estonia/Lääne-Virumaa/Rakvere'
class YrNoWeather:
"""Pulls weather data using Yr.no weather API"""
def __init__(self, location: str, timez... | 0 | 0 | 0 |
bbdfce4891418159104b900baa64b5d65abee585 | 343 | py | Python | AtCoder/ABC109/B.py | takaaki82/Java-Lessons | c4f11462bf84c091527dde5f25068498bfb2cc49 | [
"MIT"
] | 1 | 2018-11-25T04:15:45.000Z | 2018-11-25T04:15:45.000Z | AtCoder/ABC109/B.py | takaaki82/Java-Lessons | c4f11462bf84c091527dde5f25068498bfb2cc49 | [
"MIT"
] | null | null | null | AtCoder/ABC109/B.py | takaaki82/Java-Lessons | c4f11462bf84c091527dde5f25068498bfb2cc49 | [
"MIT"
] | 2 | 2018-08-08T13:01:14.000Z | 2018-11-25T12:38:36.000Z | N = int(input())
before = ""
all = set()
check = True
for i in range(N):
s = input()
if i == 0:
before = s
all.add(s)
else:
if before[-1] == s[0]:
before = s
all.add(s)
else:
check = False
if check:
print("Yes" if len(all)==N else "No")... | 17.15 | 41 | 0.437318 | N = int(input())
before = ""
all = set()
check = True
for i in range(N):
s = input()
if i == 0:
before = s
all.add(s)
else:
if before[-1] == s[0]:
before = s
all.add(s)
else:
check = False
if check:
print("Yes" if len(all)==N else "No")... | 0 | 0 | 0 |
8203b8add9eea56110ed2fd2a827153f2e83055c | 221 | py | Python | spear/labeling/__init__.py | decile-team/spear | 8f8641927325090f85af7a86bc8a5795ea4c3da9 | [
"MIT"
] | 89 | 2021-06-14T17:38:30.000Z | 2022-03-31T05:16:26.000Z | spear/labeling/__init__.py | harshading/spear | 7629cc46ce738a4a67e5b4a6ba7d1935c4833421 | [
"MIT"
] | null | null | null | spear/labeling/__init__.py | harshading/spear | 7629cc46ce738a4a67e5b4a6ba7d1935c4833421 | [
"MIT"
] | 7 | 2021-06-14T17:38:32.000Z | 2021-12-25T22:44:45.000Z | from .lf_set import LFSet
from .analysis import LFAnalysis
from .preprocess import preprocessor
from .prelabels import PreLabels
from .lf import labeling_function, ABSTAIN
from .continuous_scoring import continuous_scorer | 36.833333 | 49 | 0.859729 | from .lf_set import LFSet
from .analysis import LFAnalysis
from .preprocess import preprocessor
from .prelabels import PreLabels
from .lf import labeling_function, ABSTAIN
from .continuous_scoring import continuous_scorer | 0 | 0 | 0 |
25e89a9993493a5a34fcce98a0fb635a1eddc9f7 | 13,739 | py | Python | fabfile/utils/storage.py | sunilbasker-jnpr/contrail-fabric-utils | c5855bbc4b0cf64ff98e844a8e2c1c1705bbdf83 | [
"Apache-2.0"
] | null | null | null | fabfile/utils/storage.py | sunilbasker-jnpr/contrail-fabric-utils | c5855bbc4b0cf64ff98e844a8e2c1c1705bbdf83 | [
"Apache-2.0"
] | null | null | null | fabfile/utils/storage.py | sunilbasker-jnpr/contrail-fabric-utils | c5855bbc4b0cf64ff98e844a8e2c1c1705bbdf83 | [
"Apache-2.0"
] | 1 | 2020-08-25T12:48:58.000Z | 2020-08-25T12:48:58.000Z | import os
import sys
from netaddr import *
from fabric.api import *
from fabfile.config import testbed
from fabfile.utils.host import *
from fabfile.utils.cluster import get_all_hostnames
#end get_storage_data_ip
#end get_storage_host_string
#end get_storage_disk_config
#end get_storage_disk_config
#end get_storage_l... | 44.319355 | 101 | 0.606376 | import os
import sys
from netaddr import *
from fabric.api import *
from fabfile.config import testbed
from fabfile.utils.host import *
from fabfile.utils.cluster import get_all_hostnames
def get_storage_data_ip(host_str):
tgt_ip = None
tgt_gw= None
data_ip_info = getattr(testbed, 'storage_data', None)
... | 11,242 | 0 | 407 |
f18b79a114f6b9f48f50209993bc8afa058988e7 | 62 | py | Python | main.py | grostaco/CoreHDF | f3acf7792e99994a7c1f0a3be797ae873b04a0b6 | [
"MIT"
] | 1 | 2021-03-25T06:00:15.000Z | 2021-03-25T06:00:15.000Z | main.py | grostaco/CoreHDF | f3acf7792e99994a7c1f0a3be797ae873b04a0b6 | [
"MIT"
] | 3 | 2021-03-22T07:58:25.000Z | 2021-03-23T11:06:55.000Z | main.py | grostaco/CoreHDF | f3acf7792e99994a7c1f0a3be797ae873b04a0b6 | [
"MIT"
] | 2 | 2021-03-22T07:54:06.000Z | 2021-03-23T09:09:57.000Z | import uvicorn
import app.main as main
uvicorn.run(main.app)
| 12.4 | 23 | 0.790323 | import uvicorn
import app.main as main
uvicorn.run(main.app)
| 0 | 0 | 0 |
65012661bbf6009f8d631412eb219d4d4c3abd7f | 434 | py | Python | setup.py | dominikheinisch/pybitbay | f4dd08e2d6c762f80eaa8d1ff017ee7d6fc89fff | [
"Apache-2.0"
] | null | null | null | setup.py | dominikheinisch/pybitbay | f4dd08e2d6c762f80eaa8d1ff017ee7d6fc89fff | [
"Apache-2.0"
] | null | null | null | setup.py | dominikheinisch/pybitbay | f4dd08e2d6c762f80eaa8d1ff017ee7d6fc89fff | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="pybitbay",
version="0.0.1",
description="python api for bitbay cryptocurrency exchange",
author="dominik heinisch",
author_email="dominikheinisch2@gmail.com",
url="https://github.com/dominikheinisch/pybitbay",
license='Apache 2.0',
... | 28.933333 | 64 | 0.700461 | from setuptools import setup, find_packages
setup(
name="pybitbay",
version="0.0.1",
description="python api for bitbay cryptocurrency exchange",
author="dominik heinisch",
author_email="dominikheinisch2@gmail.com",
url="https://github.com/dominikheinisch/pybitbay",
license='Apache 2.0',
... | 0 | 0 | 0 |
dbb5ab4b27d9f747f4439423606012598314bf4a | 435 | py | Python | Old Laptop Desktop/Driving Code/Callum-s-Robotics-Code-Risk4-UNCHECKED-/connect.py | CCGSRobotics/testing_code | a963926984bb1abb9a457ea2cf6212d8362f4642 | [
"Apache-2.0"
] | null | null | null | Old Laptop Desktop/Driving Code/Callum-s-Robotics-Code-Risk4-UNCHECKED-/connect.py | CCGSRobotics/testing_code | a963926984bb1abb9a457ea2cf6212d8362f4642 | [
"Apache-2.0"
] | 1 | 2017-06-14T11:08:38.000Z | 2017-06-14T11:08:38.000Z | Old Laptop Desktop/Driving Code/Callum-s-Robotics-Code-Risk4-UNCHECKED-/connect.py | CCGSRobotics/Archive-Code | a963926984bb1abb9a457ea2cf6212d8362f4642 | [
"Apache-2.0"
] | null | null | null | print("connect setup")
import socket
HOST, PORT = "192.168.100.1",9999 #"169.254.44.240", 9999 #
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print("trying to establish a connection")
try:
sock.connect((HOST, PORT))
print("connect ready")
except:
print("CONNECTION FAILED.")
print("have you ... | 25.588235 | 59 | 0.691954 | print("connect setup")
import socket
HOST, PORT = "192.168.100.1",9999 #"169.254.44.240", 9999 #
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print("trying to establish a connection")
try:
sock.connect((HOST, PORT))
print("connect ready")
except:
print("CONNECTION FAILED.")
print("have you ... | 0 | 0 | 0 |
332f36a9d8cba0c2f5f541e19bbd22331bdc1acc | 1,427 | py | Python | io/generate_large_graph.py | murphymatt/CSC213-Final-Project | 5b566a5e115505e85c1275522e13b1fce2fb044b | [
"BSD-3-Clause"
] | null | null | null | io/generate_large_graph.py | murphymatt/CSC213-Final-Project | 5b566a5e115505e85c1275522e13b1fce2fb044b | [
"BSD-3-Clause"
] | null | null | null | io/generate_large_graph.py | murphymatt/CSC213-Final-Project | 5b566a5e115505e85c1275522e13b1fce2fb044b | [
"BSD-3-Clause"
] | null | null | null | from random import randint, sample
from functools import reduce
N_CLASSES = 200
N_STUDENTS = 1000
# create a graph-file consisting of 200 courses and 1000 students
# edges are randomly generated between students and classes
classes = map(lambda ind : "class " + str(ind), range(N_CLASSES))
students = map(lambda ind : ... | 33.97619 | 69 | 0.683952 | from random import randint, sample
from functools import reduce
N_CLASSES = 200
N_STUDENTS = 1000
def choose_classes_vary(classes, lower, upper):
num_classes = randint(lower, upper)
inds = sample(range(N_CLASSES), num_classes)
return [classes[ind] for ind in inds]
def choose_classes(classes, num_classes)... | 750 | 0 | 92 |
6a7564ebefcbde1ca3b4ea815c17bf732ba99a71 | 2,827 | py | Python | screens.py | vida18electronic/barcode | 265318d893a9dabc71231424252b2476926577ec | [
"Apache-2.0"
] | null | null | null | screens.py | vida18electronic/barcode | 265318d893a9dabc71231424252b2476926577ec | [
"Apache-2.0"
] | null | null | null | screens.py | vida18electronic/barcode | 265318d893a9dabc71231424252b2476926577ec | [
"Apache-2.0"
] | null | null | null | import lcddriver
import time
import array as arr
# Load the driver and set it to "display"
# If you use something from the driver library use the "display." prefix first
#display = lcddriver.lcd()
# Main body of code
# display.lcd_clear()
#try:
# while True:
#
# time.sleep(0.5)
# ... | 30.728261 | 104 | 0.510789 | import lcddriver
import time
import array as arr
# Load the driver and set it to "display"
# If you use something from the driver library use the "display." prefix first
#display = lcddriver.lcd()
# Main body of code
def scanbloque(bloque,display):
# display.lcd_clear()
bq=" "+str(bloque)+" ... | 2,287 | 0 | 91 |
7107becc93b7c9f99ea14e0621b654d6a5972c0e | 5,307 | py | Python | util/auth/google_bucket_auth.py | rantwijk/starthinker | fd2d70e39f05cb29afc65b8a78ea38441e1e2b9a | [
"Apache-2.0"
] | null | null | null | util/auth/google_bucket_auth.py | rantwijk/starthinker | fd2d70e39f05cb29afc65b8a78ea38441e1e2b9a | [
"Apache-2.0"
] | 204 | 2019-08-29T04:58:17.000Z | 2021-07-30T04:27:07.000Z | util/auth/google_bucket_auth.py | rantwijk/starthinker | fd2d70e39f05cb29afc65b8a78ea38441e1e2b9a | [
"Apache-2.0"
] | null | null | null | ###########################################################################
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/... | 33.588608 | 137 | 0.724515 | ###########################################################################
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/... | 3,385 | 304 | 260 |
ecd124e6b8435fe06c04a04cd396f72aa5f8d9ce | 13,145 | py | Python | src/apex/algo/pattern.py | kpwhri/apex_iud_nlp | f59afbd5d19d6bae21264f6de7ee24382ccb694e | [
"MIT"
] | 1 | 2021-09-23T18:24:15.000Z | 2021-09-23T18:24:15.000Z | src/apex/algo/pattern.py | kpwhri/apex_iud_nlp | f59afbd5d19d6bae21264f6de7ee24382ccb694e | [
"MIT"
] | null | null | null | src/apex/algo/pattern.py | kpwhri/apex_iud_nlp | f59afbd5d19d6bae21264f6de7ee24382ccb694e | [
"MIT"
] | 1 | 2021-09-23T18:24:19.000Z | 2021-09-23T18:24:19.000Z | import re
from copy import copy
| 31.149289 | 108 | 0.55291 | import re
from copy import copy
class Match:
def __init__(self, match, groups=None):
self.match = match
self._groups = groups
def group(self, *index):
if not self._groups or not index or len(index) == 1 and index[0] == 0:
return self.match.group(*index)
res = []
... | 7,411 | 4,835 | 859 |
d8052c87747897671826f747517fa49e5f15d9a2 | 852 | py | Python | Backend/foodieshoot_api/foodieshoot/migrations/0003_apks.py | eamorgado/FoodieShoot | 87172bc295edd93aa0448bc14ce85b2710dd4aab | [
"BSD-2-Clause"
] | null | null | null | Backend/foodieshoot_api/foodieshoot/migrations/0003_apks.py | eamorgado/FoodieShoot | 87172bc295edd93aa0448bc14ce85b2710dd4aab | [
"BSD-2-Clause"
] | 10 | 2020-06-06T01:56:57.000Z | 2022-03-12T00:31:25.000Z | Backend/foodieshoot_api/foodieshoot/migrations/0003_apks.py | eamorgado/FoodieShoot | 87172bc295edd93aa0448bc14ce85b2710dd4aab | [
"BSD-2-Clause"
] | 1 | 2020-07-25T09:19:37.000Z | 2020-07-25T09:19:37.000Z | # Generated by Django 2.2.6 on 2020-04-06 15:53
from django.db import migrations, models
import django.utils.timezone
import foodieshoot.models
| 30.428571 | 119 | 0.602113 | # Generated by Django 2.2.6 on 2020-04-06 15:53
from django.db import migrations, models
import django.utils.timezone
import foodieshoot.models
class Migration(migrations.Migration):
dependencies = [
('foodieshoot', '0002_auto_20200212_1925'),
]
operations = [
migrations.CreateModel(
... | 0 | 683 | 23 |