index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
14,201 | fumpen/marbar | refs/heads/master | /marbar/score_board/views.py | from django.urls import reverse
from django.shortcuts import render, redirect, HttpResponse
from .models import ScoreUnit
from management.models import MarBar
from django.http import JsonResponse
import json
from django.contrib import messages
def help_order(d):
xs = []
for x in d:
xs.append(x)
re... | {"/marbar/score_board/views.py": ["/marbar/score_board/models.py"], "/marbar/management/admin.py": ["/marbar/management/models.py"], "/marbar/management/views.py": ["/marbar/management/models.py", "/marbar/management/forms.py"]} |
14,202 | fumpen/marbar | refs/heads/master | /marbar/marbar/urls.py | """marbar URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | {"/marbar/score_board/views.py": ["/marbar/score_board/models.py"], "/marbar/management/admin.py": ["/marbar/management/models.py"], "/marbar/management/views.py": ["/marbar/management/models.py", "/marbar/management/forms.py"]} |
14,203 | fumpen/marbar | refs/heads/master | /marbar/management/migrations/0001_initial.py | # Generated by Django 2.1.1 on 2018-10-26 15:02
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Cr... | {"/marbar/score_board/views.py": ["/marbar/score_board/models.py"], "/marbar/management/admin.py": ["/marbar/management/models.py"], "/marbar/management/views.py": ["/marbar/management/models.py", "/marbar/management/forms.py"]} |
14,204 | fumpen/marbar | refs/heads/master | /marbar/management/migrations/0003_auto_20190215_1354.py | # Generated by Django 2.1.5 on 2019-02-15 13:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('management', '0002_auto_20190131_1745'),
]
operations = [
migrations.AddField(
model_name='even... | {"/marbar/score_board/views.py": ["/marbar/score_board/models.py"], "/marbar/management/admin.py": ["/marbar/management/models.py"], "/marbar/management/views.py": ["/marbar/management/models.py", "/marbar/management/forms.py"]} |
14,205 | fumpen/marbar | refs/heads/master | /marbar/management/admin.py | from django.contrib import admin
from .models import MarBar
admin.site.register(MarBar) | {"/marbar/score_board/views.py": ["/marbar/score_board/models.py"], "/marbar/management/admin.py": ["/marbar/management/models.py"], "/marbar/management/views.py": ["/marbar/management/models.py", "/marbar/management/forms.py"]} |
14,206 | fumpen/marbar | refs/heads/master | /marbar/score_board/urls.py | from django.urls import path
from . import views
urlpatterns = [
path('get_points', views.get_points, name='get_points'),
path('get_graph', views.get_graph, name='get_graph'),
path('assign_points/', views.assign_points, name='assign_points'),
] | {"/marbar/score_board/views.py": ["/marbar/score_board/models.py"], "/marbar/management/admin.py": ["/marbar/management/models.py"], "/marbar/management/views.py": ["/marbar/management/models.py", "/marbar/management/forms.py"]} |
14,207 | fumpen/marbar | refs/heads/master | /marbar/score_board/models.py | from django.db import models
class ScoreUnit(models.Model):
title = models.CharField(max_length=200, default="")
points = models.IntegerField(default=0)
placement = models.IntegerField(default=0)
marbar = models.ForeignKey('management.MarBar', on_delete=models.CASCADE)
def __str__(self):
... | {"/marbar/score_board/views.py": ["/marbar/score_board/models.py"], "/marbar/management/admin.py": ["/marbar/management/models.py"], "/marbar/management/views.py": ["/marbar/management/models.py", "/marbar/management/forms.py"]} |
14,208 | fumpen/marbar | refs/heads/master | /marbar/management/models.py | from django.db import models
from django.contrib.auth.models import User
class MarBar(models.Model):
title = models.CharField(max_length=200, default="", unique=True)
banner = models.ImageField(upload_to='banners/',
verbose_name='banner', blank=True)
users = models.ManyToMan... | {"/marbar/score_board/views.py": ["/marbar/score_board/models.py"], "/marbar/management/admin.py": ["/marbar/management/models.py"], "/marbar/management/views.py": ["/marbar/management/models.py", "/marbar/management/forms.py"]} |
14,209 | fumpen/marbar | refs/heads/master | /marbar/management/migrations/0002_auto_20190131_1745.py | # Generated by Django 2.1.5 on 2019-01-31 17:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('management', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='marbar',
old_name='user',
... | {"/marbar/score_board/views.py": ["/marbar/score_board/models.py"], "/marbar/management/admin.py": ["/marbar/management/models.py"], "/marbar/management/views.py": ["/marbar/management/models.py", "/marbar/management/forms.py"]} |
14,210 | fumpen/marbar | refs/heads/master | /marbar/management/views.py | from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.forms import UserCreationForm
from django.urls import reverse
from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from .models import MarBar, Event
from .forms import MarBarForm, EventForm
from sco... | {"/marbar/score_board/views.py": ["/marbar/score_board/models.py"], "/marbar/management/admin.py": ["/marbar/management/models.py"], "/marbar/management/views.py": ["/marbar/management/models.py", "/marbar/management/forms.py"]} |
14,245 | hujun-open/litebook | refs/heads/master | /ltbsearchdiag.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 on Mon Aug 13 11:10:41 2012
import sys
import wx
from wx.lib.mixins.listctrl import CheckListCtrlMixin
import thread
import wx.lib.newevent
from SimpleXMLRPCServer import SimpleXMLRPCServer
from SimpleXMLRPCServer import SimpleXMLRPCReq... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,246 | hujun-open/litebook | refs/heads/master | /kpub.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: KPUB
# Purpose: publish all books in the specified dir via KADP
#
# Author: Hu Jun
#
# Created: 17/08/2012
# Copyright: (c) Hu Jun 2012
# Licence: G... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,247 | hujun-open/litebook | refs/heads/master | /KADP.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Name: KADP, a Kademlia based P2P protocol
# Purpose:
#
#
# Author: Hu Jun
#
# Created: 12/09/2011
# Copyright: (c) Hu Jun 2011
# Licence: GPLv3
# for latest ve... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,248 | hujun-open/litebook | refs/heads/master | /plugin/www.ranwen.net.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#-------------------------------------------------------------------------------
# Name: litebook plugin for www.ranwen.net
# Purpose:
#
# Author:
#
# Created: 02/01/2013
#----------------------------------------------------------------------------... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,249 | hujun-open/litebook | refs/heads/master | /gcepub.py | #-------------------------------------------------------------------------------
# Name: gcepub
# Purpose: extract the catalog from epub string
#
# Author: Hu Jun
#
# Created: 29/01/2011
# Copyright: (c) Hu Jun 2011
# Licence: Apache2
#------------------------------------------------... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,250 | hujun-open/litebook | refs/heads/master | /jieba/posseg/viterbi.py | import operator
def get_top_states(t_state_v,K=4):
items = t_state_v.items()
topK= sorted(items,key=operator.itemgetter(1),reverse=True)[:K]
return [x[0] for x in topK]
def viterbi(obs, states, start_p, trans_p, emit_p):
V = [{}] #tabular
mem_path = [{}]
all_states = trans_p.keys()
for y in states.get(obs[0],a... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,251 | hujun-open/litebook | refs/heads/master | /myup.py | #-------------------------------------------------------------------------------
# Name: A UPNP Client to add port forward mapping on 1st respond router
# Purpose:
#
# Author: Hu Jun
#
# Created: 23/12/2012
# Copyright: (c) Hu Jun 2012
# Licence: GPLv2
#-----------------------------------... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,252 | hujun-open/litebook | refs/heads/master | /longbin.py | #-------------------------------------------------------------------------------
# Name: LongBin
# Purpose: For long binary number manipulation
#
# Author: Hu Jun
#
# Created: 16/09/2011
# Copyright: (c) Hu Jun 2011
# Licence: GPLv3
#--------------------------------------------------... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,253 | hujun-open/litebook | refs/heads/master | /litebook.py | #!/usr/bin/env py32
# -*- coding: utf-8 -*-
#This is the source file of LiteBook (for all Windows/Linux/OSX)
#see Readme.txt for module dependcy
#
#
#
import locale
SYSENC=locale.getdefaultlocale()[1]
import sys
FullVersion=False
if len(sys.argv)>1:
if sys.argv[1]=='-full':
FullVersion=True
if FullVersio... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,254 | hujun-open/litebook | refs/heads/master | /UnRAR2/__init__.py | # Copyright (c) 2003-2005 Jimmy Retzlaff, 2008 Konstantin Yegupov
#
# 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,... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,255 | hujun-open/litebook | refs/heads/master | /keygrid.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is a grid based class used to configure keymap
import wx
import wx.grid as gridlib
import string
# begin wxGlade: extracode
# end wxGlade
KeyMap = {
wx.WXK_BACK : "WXK_BACK",
wx.WXK_TAB : "WXK_TAB",
wx.WXK_RETURN... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,256 | hujun-open/litebook | refs/heads/master | /UnRAR2/test_UnRAR2.py | import os, sys
import UnRAR2
from UnRAR2.rar_exceptions import *
def cleanup(dir='test'):
for path, dirs, files in os.walk(dir):
for fn in files:
os.remove(os.path.join(path, fn))
for dir in dirs:
os.removedirs(os.path.join(path, dir))
# reuse RarArch... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,257 | hujun-open/litebook | refs/heads/master | /liteview.py | #!/usr/bin/env py32
# -*- coding: utf-8 -*-
#
#
u"""LiteView is a read-only optimized wxpython text control, which provides
following features:
- 3 show modes: paper/book/vbook
- configurable: background(picture)/font/underline/margin
- render speed is almost independent of file size
Author: Hu Jun
upda... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,258 | hujun-open/litebook | refs/heads/master | /jf.py | #!/usr/bin/env py32
# -*- coding: utf-8 -*-
#
import codecs
import os.path
import sys
rpath=os.path.abspath(sys.argv[0])
rpath=os.path.dirname(rpath)
rpath=os.path.join(rpath,'jf.dat')
jfdb=codecs.open(rpath,'r','utf-8')
j2f=f2j={}
for line in jfdb:
j,f=line.strip().split()
j2f[j]=f
f2j[f]=j
j2ftable =... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,259 | hujun-open/litebook | refs/heads/master | /web_download_manager.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 on Sun Jul 08 15:59:49 2012
import wx
import wx.lib.newevent
import fileDownloader
import urlparse
import sys
import os
import thread
import traceback
import urllib
import platform
import os
# begin wxGlade: extracode
# end wx... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,260 | hujun-open/litebook | refs/heads/master | /ComboDialog.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 on Thu Jan 13 21:44:56 2011
import wx
# begin wxGlade: extracode
# end wxGlade
class ComboDialog(wx.Dialog):
def __init__(self, parent,ichoice=[],ititle='',idesc=''):
# begin wxGlade: MyDialog.__init__
wx.D... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,261 | hujun-open/litebook | refs/heads/master | /UnRAR2/setup.py | # setup.py, config file for distutils
import __init__
from distutils.core import setup
from distutils.command.install_data import install_data
import os
class smart_install_data(install_data):
def run(self):
#need to change self.install_dir to the actual library dir
install_cmd = sel... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,262 | hujun-open/litebook | refs/heads/master | /UnRAR2/unix.py | # Copyright (c) 2003-2005 Jimmy Retzlaff, 2008 Konstantin Yegupov
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,263 | hujun-open/litebook | refs/heads/master | /fileDownloader.py | """Downloads files from http or ftp locations"""
import os
import urllib2
import ftplib
import urlparse
import urllib
import sys
import socket
version = "0.4.0"
class DownloadFile(object):
"""This class is used for downloading files from the internet via http or ftp.
It supports basic http authen... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,264 | hujun-open/litebook | refs/heads/master | /plugin/www.23xsw.net.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#-------------------------------------------------------------------------------
# Name: litebook plugin for www.ranwen.net
# Purpose:
#
# Author:
#
# Created: 02/01/2013
#-------------------------------------------------------------------------------
#!/usr/... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,265 | hujun-open/litebook | refs/heads/master | /download_manager.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 on Sun Jul 08 15:59:49 2012
import wx
import wx.lib.newevent
import fileDownloader
import urlparse
import sys
import os
import thread
import traceback
import urllib
import platform
import os
# begin wxGlade: extracode
# end wx... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,266 | hujun-open/litebook | refs/heads/master | /build.py | from distutils.core import setup
import glob
import py2exe
import os,sys
import shutil
def myignore(src,name):
return (['.svn',])
sys.argv.append('py2exe')
setup(windows=[{'script':'litebook.py',"icon_resources": [(1, "litebook.ico")]},],
data_files=[('templates', glob.glob('templates/*.*')),
... | {"/UnRAR2/test_UnRAR2.py": ["/UnRAR2/__init__.py"], "/web_download_manager.py": ["/fileDownloader.py"]} |
14,274 | Prakyathkantharaju/sokobanAI | refs/heads/master | /Agents/utils.py |
MAXIMUM_FLOAT_VALUE = float('inf')
class MinMaxStats(object):
"""A class that holds the min-max values of the tree."""
def __init__(self, known_bounds):
self.maximum = known_bounds.max if known_bounds else -MAXIMUM_FLOAT_VALUE
self.minimum = known_bounds.min if known_bounds else MAXIMUM_FLOAT... | {"/Agents/examples/Random_Sampling.py": ["/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"], "/Agents/MCTS/MainMCTS.py": ["/Agents/utils.py", "/Agents/MCTS/utils.py", "/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"]} |
14,275 | Prakyathkantharaju/sokobanAI | refs/heads/master | /Agents/DDQN/main.py | # general import
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import time, sys
# relative import
sys.path.append('/home/prakyath/gitfolder/sokoban')
from Agents.DDQN.Agent import Agent
import gym
import gym_sokoban
if __name__ == '__main__':
tf.compat.v1.disable_eager_execution()
... | {"/Agents/examples/Random_Sampling.py": ["/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"], "/Agents/MCTS/MainMCTS.py": ["/Agents/utils.py", "/Agents/MCTS/utils.py", "/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"]} |
14,276 | Prakyathkantharaju/sokobanAI | refs/heads/master | /Agents/examples/Random_Sampling.py | import gym
import numpy as np
import gym_sokoban
import time
import os,sys
# realtive import
print(os.getcwd())
sys.path.append('/home/prakyath/gitfolder/sokoban')
from Agents.cost_functions.cost import MSE
from Agents.trees.MainTree import State, Match_state
# Before you can make a Sokoban Environment you need to call... | {"/Agents/examples/Random_Sampling.py": ["/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"], "/Agents/MCTS/MainMCTS.py": ["/Agents/utils.py", "/Agents/MCTS/utils.py", "/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"]} |
14,277 | Prakyathkantharaju/sokobanAI | refs/heads/master | /Agents/trees/MainTree.py | # general imports
import numpy as np
# This file is for state tree construction
# This will have following class/function
# - State: each state class
# - Match_state: function to return true is states are matched
class State(object):
"""State."""
'''
state class
to have child, parent and occurance i... | {"/Agents/examples/Random_Sampling.py": ["/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"], "/Agents/MCTS/MainMCTS.py": ["/Agents/utils.py", "/Agents/MCTS/utils.py", "/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"]} |
14,278 | Prakyathkantharaju/sokobanAI | refs/heads/master | /Agents/cost_functions/cost.py | # General import
import numpy as np
# base class
class cost(object):
def __init__(self, no_of_goals = 3):
self.state_number = no_of_goals
def evaluate(self,goals,target,player):
raise NotImplemented
# Mean square error
class MSE(cost):
def __init__(self,no_of_goals = 3, cost_type = 'SUM')... | {"/Agents/examples/Random_Sampling.py": ["/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"], "/Agents/MCTS/MainMCTS.py": ["/Agents/utils.py", "/Agents/MCTS/utils.py", "/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"]} |
14,279 | Prakyathkantharaju/sokobanAI | refs/heads/master | /old_env/sokoban_env.py | # import general ai
import gym
import numpy as np
# import game
try:
import sokoban.game as game
except:
from env.sokoban_game import game
# this is the gym
class sokoban_env(gym.Env):
def __init__(self,level):
self.game = game('env/levels', level)
self.state = {}
self.state['worke... | {"/Agents/examples/Random_Sampling.py": ["/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"], "/Agents/MCTS/MainMCTS.py": ["/Agents/utils.py", "/Agents/MCTS/utils.py", "/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"]} |
14,280 | Prakyathkantharaju/sokobanAI | refs/heads/master | /Agents/MCTS/utils.py | import numpy as np
def Match_goal_box(previous_state, new_state):
box_loc = get_box_loc(previous_state) == get_box_loc(new_state)
goal_loc = get_goals_loc(previous_state) == get_box_loc(new_state)
if box_loc.all() and goal_loc.all():
return True
else:
return False
def get_box_loc(sta... | {"/Agents/examples/Random_Sampling.py": ["/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"], "/Agents/MCTS/MainMCTS.py": ["/Agents/utils.py", "/Agents/MCTS/utils.py", "/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"]} |
14,281 | Prakyathkantharaju/sokobanAI | refs/heads/master | /test.py | from env.sokoban_env import sokoban_env
env = sokoban_env(1)
env.get_state()
| {"/Agents/examples/Random_Sampling.py": ["/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"], "/Agents/MCTS/MainMCTS.py": ["/Agents/utils.py", "/Agents/MCTS/utils.py", "/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"]} |
14,282 | Prakyathkantharaju/sokobanAI | refs/heads/master | /Agents/state_queue.py | # This class is to store the state and weight for A-star search
class queue(object):
def __init__(self,len_state):
# len_state is the len of the box + worker
self.data = {}
| {"/Agents/examples/Random_Sampling.py": ["/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"], "/Agents/MCTS/MainMCTS.py": ["/Agents/utils.py", "/Agents/MCTS/utils.py", "/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"]} |
14,283 | Prakyathkantharaju/sokobanAI | refs/heads/master | /Agents/MCTS/MainMCTS.py | # Main Monte carlo tree search file
import collections, math
import gym, time
import numpy as np
import gym_sokoban, copy, random
import time, os, sys
print(os.getcwd())
sys.path.append('/home/prakyath/gitfolder/sokoban/')
from Agents.utils import MinMaxStats
from Agents.MCTS.utils import Match_goal_box
# relative imp... | {"/Agents/examples/Random_Sampling.py": ["/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"], "/Agents/MCTS/MainMCTS.py": ["/Agents/utils.py", "/Agents/MCTS/utils.py", "/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"]} |
14,284 | Prakyathkantharaju/sokobanAI | refs/heads/master | /Agents/test.py | import gym
import gym_sokoban
| {"/Agents/examples/Random_Sampling.py": ["/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"], "/Agents/MCTS/MainMCTS.py": ["/Agents/utils.py", "/Agents/MCTS/utils.py", "/Agents/cost_functions/cost.py", "/Agents/trees/MainTree.py"]} |
14,306 | ishan-marikar/JSPyBridge | refs/heads/master | /src/pythonia/Bridge.py | import inspect, importlib, importlib.util
import json, types, traceback, os, sys
from proxy import Executor, Proxy
from weakref import WeakValueDictionary
def python(method):
return importlib.import_module(method, package=None)
def fileImport(moduleName, absolutePath, folderPath):
if folderPath not in sys.p... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,307 | ishan-marikar/JSPyBridge | refs/heads/master | /src/javascript/__main__.py | import os, sys, argparse, shutil
parser = argparse.ArgumentParser(
description="javascript (JSPyBridge) package manager. Use this to clear or update the internal package store."
)
parser.add_argument("--clean", default=False, action="store_true")
parser.add_argument("--update", default=False, action="store_true")
... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,308 | ishan-marikar/JSPyBridge | refs/heads/master | /test/pythonia/pyImp.py | print("hello world :)")
def add_inverse(a, b):
return -1 * (a + b)
def complex_num():
return 1j * 1j
def inner():
return 3
def some_event(cb, vfn):
print("CB", cb, vfn, vfn.someMethod(), vfn.get(3))
cb("from python", inner)
def iter(obj):
ret = []
for key in obj:
ret.append... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,309 | ishan-marikar/JSPyBridge | refs/heads/master | /test/javascript/test_general.py | from javascript import require, console, On, Once, off, once, eval_js
def assertEquals(cond, val): assert cond == val
def test_require():
chalk = require("chalk")
fs = require("fs")
print("Hello", chalk.red("world!"))
test = require("./test.js")
def test_classes():
global demo
DemoClass = re... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,310 | ishan-marikar/JSPyBridge | refs/heads/master | /examples/python/nbt.py | # Named Binary Tag (NBT) serialization format
from javascript import require, globalThis
JSON = globalThis.JSON
nbt = require("prismarine-nbt", "latest")
print(nbt.comp({
'Armor': nbt.list(nbt.comp([
{
'Count': nbt.byte(1),
'Damage': nbt.short(0),
'Name': nbt.string('hel... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,311 | ishan-marikar/JSPyBridge | refs/heads/master | /src/pythonia/interface.py | from Bridge import Bridge
import sys, os, socket, json
apiin = apiout = None
class Ipc:
def queue(self, what):
global apiout
try:
if type(what) == str:
apiout.write(what + "\n")
else:
apiout.write(json.dumps(what) + "\n")
apiout.... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,312 | ishan-marikar/JSPyBridge | refs/heads/master | /examples/python/flyingsquid.py | import time
from javascript import require
mcServer = require('flying-squid')
mcServer.createMCServer({
'motd': 'A Minecraft Server \nRunning flying-squid',
'port': 25565,
'max-players': 10,
'online-mode': True,
'logging': True,
'gameMode': 1,
'difficulty': 1,
'worldFolder': 'world',
'generation': {
... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,313 | ishan-marikar/JSPyBridge | refs/heads/master | /src/javascript/__init__.py | # This file contains all the exposed modules
from . import config, proxy, events
import threading, inspect, time, atexit, os, sys
def init():
if config.event_loop:
return # Do not start event loop again
config.event_loop = events.EventLoop()
config.event_thread = threading.Thread(target=config.ev... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,314 | ishan-marikar/JSPyBridge | refs/heads/master | /src/javascript/config.py | import os
event_loop = None
event_thread = None
executor = None
# The "root" interface to JavaScript with FFID 0
global_jsi = None
# Currently this breaks GC
fast_mode = False
# Whether we need patches for legacy node versions
node_emitter_patches = False
if ("DEBUG" in os.environ) and ("jspybridge" in os.getenv("DE... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,315 | ishan-marikar/JSPyBridge | refs/heads/master | /src/javascript/errors.py | import re, sys, traceback
class JavaScriptError(Exception):
def __init__(self, call, jsStackTrace, pyStacktrace=None):
self.call = call
self.js = jsStackTrace
self.py = pyStacktrace
class Chalk:
def red(self, text):
return "\033[91m" + text + "\033[0m"
def blue(self, tex... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,316 | ishan-marikar/JSPyBridge | refs/heads/master | /src/javascript/proxy.py | import time, threading, json, sys, os, traceback
from . import config, json_patch
from .errors import JavaScriptError
debug = config.debug
# This is the Executor, something that sits in the middle of the Bridge and is the interface for
# Python to JavaScript. This is also used by the bridge to call Python from Node.j... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,317 | ishan-marikar/JSPyBridge | refs/heads/master | /test/javascript/test.py | import os
import time
from javascript import require, console, On, Once, off, once, eval_js
DemoClass = require("./test.js").DemoClass
chalk, fs = require("chalk"), require("fs")
console.log("Hello", chalk.red("world!"))
fs.writeFileSync("HelloWorld.txt", "hi!")
demo = DemoClass("blue", {"a": 3}, lambda v: print("S... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,318 | ishan-marikar/JSPyBridge | refs/heads/master | /src/javascript/connection.py | import threading, subprocess, json, time, signal
import atexit, os, sys
from . import config
from .config import debug
# Special handling for IPython jupyter notebooks
stdout = sys.stdout
notebook = False
NODE_BIN = getattr(os.environ, "NODE_BIN") if hasattr(os.environ, "NODE_BIN") else "node"
def is_notebook():
... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,319 | ishan-marikar/JSPyBridge | refs/heads/master | /examples/python/cheerio.py | from javascript import require
cheerio = require('cheerio');
C = cheerio.load('<h2 class="title">Hello world</h2>')
C('h2.title').text('Hello there!')
C('h2').addClass('welcome')
print(C.html()) | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,320 | ishan-marikar/JSPyBridge | refs/heads/master | /src/javascript/pyi.py | # THe Python Interface for JavaScript
import inspect, importlib, traceback
import os, sys, json, types
import socket
from .proxy import Proxy
from .errors import JavaScriptError, getErrorMessage
from weakref import WeakValueDictionary
def python(method):
return importlib.import_module(method, package=None)
def... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,321 | ishan-marikar/JSPyBridge | refs/heads/master | /test/pythonia/demo.py | def add(demoClas1, demoClas2):
# print("dc", demoClas1, demoClas2)
return demoClas1.var + demoClas2.var
def throw():
raise Exception("hey I crashed!")
def special(pos1, pos2, /, kwarg1=None, **kwargs):
print("Fn call", pos1, pos2, kwarg1, kwargs)
class DemoClass:
"""Some doc"""
def __init... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,322 | ishan-marikar/JSPyBridge | refs/heads/master | /examples/python/webserver.py | import time
from javascript import require
http = require('http')
def handler(this, req, res):
res.writeHead(200, {'Content-Type': 'text/plain'})
res.end('Hello World!')
http.createServer(handler).listen(8080)
# Keep the Python process alive
time.sleep(100) | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,323 | ishan-marikar/JSPyBridge | refs/heads/master | /src/javascript/events.py | import time, threading, json, sys
from . import connection, config, pyi
from queue import Queue
from weakref import WeakValueDictionary
class TaskState:
def __init__(self):
self.stopping = False
self.sleep = self.wait
def wait(self, sec):
stopTime = time.time() + sec
while tim... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,324 | ishan-marikar/JSPyBridge | refs/heads/master | /src/pythonia/ws.py | # WebSocket Interface for Python access
from Bridge import Bridge
from queue import Queue
import threading, json
import asyncio
import websockets
loop = asyncio.get_event_loop()
sendQ = asyncio.Queue()
class WsCom:
recvQ = Queue()
sendQ = Queue()
socket = None
def readline(self):
return self... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,325 | ishan-marikar/JSPyBridge | refs/heads/master | /src/pythonia/proxy.py | import time, threading, json
import json_patch
debug = lambda *a: a
# debug = print
class JavaScriptError(Exception):
pass
# This is the Executor, something that sits in the middle of the Bridge and is the interface for
# Python to JavaScript. This is also used by the bridge to call Python from Node.js.
class ... | {"/src/javascript/proxy.py": ["/src/javascript/__init__.py", "/src/javascript/errors.py"], "/src/javascript/connection.py": ["/src/javascript/__init__.py", "/src/javascript/config.py"], "/src/javascript/pyi.py": ["/src/javascript/proxy.py", "/src/javascript/errors.py"], "/src/javascript/events.py": ["/src/javascript/__... |
14,329 | DrIndy/Py-Image-Processing | refs/heads/master | /ImgFilters.py | #!/usr/bin/env python3
'''
===============================================================================
ENGR 133 Program Description
Immage Processing, filters
Assignment Information
Assignment: Python Project
Author: Matthew Glimcher, mglimche@purdue.edu
Team ID: 004-01 (e.g. 001... | {"/ImgMain.py": ["/ImgFilters.py", "/ToGrayscale.py", "/Rotate_and_Mirror.py"]} |
14,330 | DrIndy/Py-Image-Processing | refs/heads/master | /ToGrayscale.py | #!/usr/bin/env python3
'''
===============================================================================
ENGR 133 Program Description
Immage Processing, Greyscale
Assignment Information
Assignment: Python Project
Author: Kai Wilson, wils1064@purdue.edu
Team ID: 004-01 (e.g. 001-14 for section... | {"/ImgMain.py": ["/ImgFilters.py", "/ToGrayscale.py", "/Rotate_and_Mirror.py"]} |
14,331 | DrIndy/Py-Image-Processing | refs/heads/master | /ImgMain.py | #!/usr/bin/env python3
'''
===============================================================================
ENGR 133 Program Description
Immage Processing Main Menu
Assignment Information
Assignment: Python Project
Author: Matthew Glimcher, mglimche@purdue.edu
Team ID: 004-01 (e.g. 00... | {"/ImgMain.py": ["/ImgFilters.py", "/ToGrayscale.py", "/Rotate_and_Mirror.py"]} |
14,332 | DrIndy/Py-Image-Processing | refs/heads/master | /Rotate_and_Mirror.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
===============================================================================
ENGR 133 Program Description
Can take in an array of an image and rotate or mirror the image
Assignment Information
Assignment: Python Project
Author: Chase Weinstein, cwei... | {"/ImgMain.py": ["/ImgFilters.py", "/ToGrayscale.py", "/Rotate_and_Mirror.py"]} |
14,334 | paulsmith/letsgetlouder | refs/heads/master | /setup.py | from setuptools import setup, find_packages
setup(
name='letsgetlouder.com',
version='0.1',
description='Django community pledge site',
url='http://letsgetlouder.com/',
install_requires=['Django==1.4', 'django-social-auth==0.6.9'],
packages=find_packages(),
license='BSD'
)
| {"/letsgetlouder/views.py": ["/pledge/models.py"]} |
14,335 | paulsmith/letsgetlouder | refs/heads/master | /pledge/models.py | from django.db import models
from django.db.models.signals import post_save
from django.contrib.auth.models import User
class Signee(models.Model):
user = models.OneToOneField(User)
signed = models.BooleanField(default=False)
when = models.DateTimeField(auto_now_add=True)
def sign_pledge(sender, instance,... | {"/letsgetlouder/views.py": ["/pledge/models.py"]} |
14,336 | paulsmith/letsgetlouder | refs/heads/master | /letsgetlouder/urls.py | from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'letsgetlouder.views.index_view'),
url(r'^account/$', TemplateView.as_view(template_name='account.html')),
url(r... | {"/letsgetlouder/views.py": ["/pledge/models.py"]} |
14,337 | paulsmith/letsgetlouder | refs/heads/master | /letsgetlouder/local_settings.example.py | from letsgetlouder.settings import *
# You will need to get these from either Paul or Julia
TWITTER_CONSUMER_KEY = ''
TWITTER_CONSUMER_SECRET = ''
FACEBOOK_APP_ID = ''
FACEBOOK_API_SECRET = ''
GITHUB_APP_ID = ''
GITHUB_API_SECR... | {"/letsgetlouder/views.py": ["/pledge/models.py"]} |
14,338 | paulsmith/letsgetlouder | refs/heads/master | /letsgetlouder/views.py | from django.contrib.auth import logout
from django.shortcuts import redirect, render
from pledge.models import Signee
def index_view(request):
signees = Signee.objects.filter(signed=True).order_by('-when').\
select_related('user')
signees = [s.user for s in signees]
return render(request, ... | {"/letsgetlouder/views.py": ["/pledge/models.py"]} |
14,349 | abdulazizaziz/News_portal | refs/heads/main | /news/urls.py | from django.contrib import admin
from django.urls import path, include
from news.views import main_page, post
app_name = "news"
urlpatterns = [
path('', main_page, name='main_page'),
path('post/<int:id>/', post, name='post'),
]
| {"/news/urls.py": ["/news/views.py"], "/admin_panel/views.py": ["/news/models.py"], "/news/views.py": ["/news/models.py"], "/admin_panel/urls.py": ["/admin_panel/views.py"]} |
14,350 | abdulazizaziz/News_portal | refs/heads/main | /admin_panel/admin.py | from django.contrib import admin
from admin_panel.models import Users
# Register your models here.
admin.site.register(Users) | {"/news/urls.py": ["/news/views.py"], "/admin_panel/views.py": ["/news/models.py"], "/news/views.py": ["/news/models.py"], "/admin_panel/urls.py": ["/admin_panel/views.py"]} |
14,351 | abdulazizaziz/News_portal | refs/heads/main | /news/models.py | from django.db import models
from admin_panel.models import Users
# Create your models here.
class Category(models.Model):
category_name = models.CharField(max_length=30, unique=True)
category_post = models.IntegerField()
def __str__(self):
return self.category_name + " - " + str(self.category_pos... | {"/news/urls.py": ["/news/views.py"], "/admin_panel/views.py": ["/news/models.py"], "/news/views.py": ["/news/models.py"], "/admin_panel/urls.py": ["/admin_panel/views.py"]} |
14,352 | abdulazizaziz/News_portal | refs/heads/main | /admin_panel/views.py | from django.shortcuts import render, HttpResponseRedirect
from news.models import Post, Category
from django.urls import reverse_lazy
from .models import Users
# Create your views here.
# login and logout pages
# controling with sesssions
for_login_page = {
'title': "LOGIN"
}
def login(request):
if request... | {"/news/urls.py": ["/news/views.py"], "/admin_panel/views.py": ["/news/models.py"], "/news/views.py": ["/news/models.py"], "/admin_panel/urls.py": ["/admin_panel/views.py"]} |
14,353 | abdulazizaziz/News_portal | refs/heads/main | /news/views.py | from django.shortcuts import render, HttpResponseRedirect
from news.models import Category, Post
from django.urls import reverse_lazy
# Create your views here.
category = Category.objects.all()
post = Post.objects.all()
for_main_page = {
'title': "news",
"categorys": category,
'posts': Post.objects.all(),... | {"/news/urls.py": ["/news/views.py"], "/admin_panel/views.py": ["/news/models.py"], "/news/views.py": ["/news/models.py"], "/admin_panel/urls.py": ["/admin_panel/views.py"]} |
14,354 | abdulazizaziz/News_portal | refs/heads/main | /admin_panel/migrations/0003_alter_users_options.py | # Generated by Django 3.2.5 on 2021-07-30 13:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('admin_panel', '0002_alter_users_table'),
]
operations = [
migrations.AlterModelOptions(
name='users',
options={'ordering': [... | {"/news/urls.py": ["/news/views.py"], "/admin_panel/views.py": ["/news/models.py"], "/news/views.py": ["/news/models.py"], "/admin_panel/urls.py": ["/admin_panel/views.py"]} |
14,355 | abdulazizaziz/News_portal | refs/heads/main | /admin_panel/urls.py | from django.contrib import admin
from django.urls import path
from .views import main_page, delete, edit, update, login, logout, create, category, create_category, delete_category, update_category
from .views import users, create_user, delete_user
app_name = "admin_panel"
urlpatterns = [
path('', main_page, name=... | {"/news/urls.py": ["/news/views.py"], "/admin_panel/views.py": ["/news/models.py"], "/news/views.py": ["/news/models.py"], "/admin_panel/urls.py": ["/admin_panel/views.py"]} |
14,356 | sustr4/Sentinel_tutorial | refs/heads/main | /image_clip.py | """
This function clipped all images in specified folder according to the geojson file and save output to specified folder
"""
import os
import fiona
import rasterio
from rasterio.mask import mask
def clipper(image_path, geojson, new_folder):
file_list = os.listdir(image_path)
file_list.sort()
# use fio... | {"/bbox_converter.py": ["/use_functions.py"]} |
14,357 | sustr4/Sentinel_tutorial | refs/heads/main | /use_functions.py | # Useful functions
import numpy as np
import rasterio
from rasterio.coords import BoundingBox
def reverse_coordinates(pol):
"""
Reverse the coordinates in pol
Receives list of coordinates: [[x1,y1],[x2,y2],...,[xN,yN]]
Returns [[y1,x1],[y2,x2],...,[yN,xN]]
"""
return [list(f[-1::-1]) for f in ... | {"/bbox_converter.py": ["/use_functions.py"]} |
14,358 | sustr4/Sentinel_tutorial | refs/heads/main | /bbox_converter.py | """
Converts coordinates as BoundingBox from GPS coorodinates (latitude/longitude - epsg:4326) from geojson file to any chosen epsg projection
and saving these new coordinates to the new geojson file (new_file)
"""
import json
import geojson
import rasterio
from rasterio import warp
from use_functions import genera... | {"/bbox_converter.py": ["/use_functions.py"]} |
14,359 | sustr4/Sentinel_tutorial | refs/heads/main | /image_functions.py |
import numpy as np
import matplotlib.pyplot as plt
import rasterio
from pathlib import Path
from rasterio.enums import Resampling
from rasterio.plot import adjust_band
def load_sentinel_image(img_folder, bands):
image = {}
path = Path(img_folder)
for band in bands:
file = img_folder + band + ".tif... | {"/bbox_converter.py": ["/use_functions.py"]} |
14,360 | sustr4/Sentinel_tutorial | refs/heads/main | /coordinates_converter.py | """
Converts coordinates from GPS coorodinates (latitude/longitude - epsg:4326) from geojson file to any chosen epsg projection
and saving these new coordinates to the new geojson file (new_file)
"""
import pyproj
import geojson
import json
def coor_converter(file, new_file, epsg):
# Transformation from GPS co... | {"/bbox_converter.py": ["/use_functions.py"]} |
14,362 | elessarelfstone/advarchs | refs/heads/master | /tests/test_advarchs.py | import os
import string
from contextlib import contextmanager
import pytest
from advarchs import __version__
from advarchs import download, filename_from_content_disposition, webfilename
from advarchs import extract, extract_web_archive
from advarchs.utils import get_hash_memory_optimized, file_ext
from tests.fixtur... | {"/tests/test_advarchs.py": ["/advarchs/__init__.py", "/advarchs/utils.py", "/tests/fixtures/__init__.py", "/tests/__init__.py"], "/tests/fixtures/__init__.py": ["/advarchs/utils.py", "/tests/__init__.py"], "/advarchs/handlers.py": ["/advarchs/utils.py"], "/advarchs/__init__.py": ["/advarchs/utils.py", "/advarchs/handl... |
14,363 | elessarelfstone/advarchs | refs/heads/master | /tests/fixtures/__init__.py | import os
import pytest
from advarchs.utils import (
create_file,
add_file_to_zip,
add_file_to_tar,
random_string)
from tests import TEMP_DIR
TEST_LOCAL_ARCHIVES = [
("zip_test_local", add_file_to_zip, ["local_test.jpg", "local_test.png", "local_test.docx"
,"local_test.x... | {"/tests/test_advarchs.py": ["/advarchs/__init__.py", "/advarchs/utils.py", "/tests/fixtures/__init__.py", "/tests/__init__.py"], "/tests/fixtures/__init__.py": ["/advarchs/utils.py", "/tests/__init__.py"], "/advarchs/handlers.py": ["/advarchs/utils.py"], "/advarchs/__init__.py": ["/advarchs/utils.py", "/advarchs/handl... |
14,364 | elessarelfstone/advarchs | refs/heads/master | /advarchs/handlers.py | import abc
import re
import os
import sys
from enum import Enum
from itertools import groupby
from advarchs.utils import run_with_output
CONSOLE_CODING = 'utf8'
if sys.platform == 'win32':
CONSOLE_CODING = 'cp866'
class ArchiveStatus(Enum):
ALL_GOOD = 0
NOT_COMPATIBLE = 1
CORRUPTED = 2
UNKNOWN_... | {"/tests/test_advarchs.py": ["/advarchs/__init__.py", "/advarchs/utils.py", "/tests/fixtures/__init__.py", "/tests/__init__.py"], "/tests/fixtures/__init__.py": ["/advarchs/utils.py", "/tests/__init__.py"], "/advarchs/handlers.py": ["/advarchs/utils.py"], "/advarchs/__init__.py": ["/advarchs/utils.py", "/advarchs/handl... |
14,365 | elessarelfstone/advarchs | refs/heads/master | /advarchs/__init__.py | import os
from shutil import which
import string
import tempfile
from mailbox import Message
import requests
from advarchs.utils import file_ext, extract_version, get_hash_memory_optimized
from advarchs.handlers import (HandlersFactory, AdvarchsExtractException,
ArchiveStatus, SevenZHan... | {"/tests/test_advarchs.py": ["/advarchs/__init__.py", "/advarchs/utils.py", "/tests/fixtures/__init__.py", "/tests/__init__.py"], "/tests/fixtures/__init__.py": ["/advarchs/utils.py", "/tests/__init__.py"], "/advarchs/handlers.py": ["/advarchs/utils.py"], "/advarchs/__init__.py": ["/advarchs/utils.py", "/advarchs/handl... |
14,366 | elessarelfstone/advarchs | refs/heads/master | /tests/__init__.py | import tempfile
TEMP_DIR = tempfile.gettempdir()
| {"/tests/test_advarchs.py": ["/advarchs/__init__.py", "/advarchs/utils.py", "/tests/fixtures/__init__.py", "/tests/__init__.py"], "/tests/fixtures/__init__.py": ["/advarchs/utils.py", "/tests/__init__.py"], "/advarchs/handlers.py": ["/advarchs/utils.py"], "/advarchs/__init__.py": ["/advarchs/utils.py", "/advarchs/handl... |
14,367 | elessarelfstone/advarchs | refs/heads/master | /advarchs/utils.py | import os
import hashlib
import tarfile
import subprocess as subp
from random import choice, randint
from string import ascii_uppercase
from zipfile import ZipFile
from pathlib import Path
import tomlkit
def extract_version(source_file):
""" Extract package version from pyproject file """
d = Path(source_fil... | {"/tests/test_advarchs.py": ["/advarchs/__init__.py", "/advarchs/utils.py", "/tests/fixtures/__init__.py", "/tests/__init__.py"], "/tests/fixtures/__init__.py": ["/advarchs/utils.py", "/tests/__init__.py"], "/advarchs/handlers.py": ["/advarchs/utils.py"], "/advarchs/__init__.py": ["/advarchs/utils.py", "/advarchs/handl... |
14,416 | chakra34/SphericalOrientations | refs/heads/master | /Code/Spherical/orientation.py | # -*- coding: UTF-8 no BOM -*-
# obtained from https://damask.mpie.de #
###################################################
# NOTE: everything here needs to be a np array #
###################################################
import math,os
import numpy as np
# *******************************************************... | {"/Code/Spherical/__init__.py": ["/Code/Spherical/asciitable.py", "/Code/Spherical/orientation.py", "/Code/Spherical/util.py"]} |
14,417 | chakra34/SphericalOrientations | refs/heads/master | /Code/equidistant_SphericalTriangle.py | #!/usr/bin/env python
###########################################################################
# Authors #
# Aritra Chakraborty #
# Philip Eisenlohr ... | {"/Code/Spherical/__init__.py": ["/Code/Spherical/asciitable.py", "/Code/Spherical/orientation.py", "/Code/Spherical/util.py"]} |
14,418 | chakra34/SphericalOrientations | refs/heads/master | /Code/Spherical/asciitable.py | # -*- coding: UTF-8 no BOM -*-
# obtained from https://damask.mpie.de #
import os,sys
import numpy as np
# ------------------------------------------------------------------
# python 3 has no unicode object, this ensures that the code works on Python 2&3
try:
test=isinstance('test', unicode)
except(NameError):
u... | {"/Code/Spherical/__init__.py": ["/Code/Spherical/asciitable.py", "/Code/Spherical/orientation.py", "/Code/Spherical/util.py"]} |
14,419 | chakra34/SphericalOrientations | refs/heads/master | /Code/Spherical/__init__.py | # -*- coding: UTF-8 no BOM -*-
"""Main aggregator"""
import os
from .asciitable import ASCIItable # noqa
from .orientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa
from .util import extendableOption # noqa
| {"/Code/Spherical/__init__.py": ["/Code/Spherical/asciitable.py", "/Code/Spherical/orientation.py", "/Code/Spherical/util.py"]} |
14,420 | chakra34/SphericalOrientations | refs/heads/master | /Code/unitcell.py | #!/usr/bin/env python
# line [thinvectorstyle] (O)(px)
# line [thinvectorstyle] (O)(py)
# # line [thinvectorstyle] (O)(pz)
# special | \path #1 -- #2 node[at end, below] {$ x $}; | (O)(px)
# special | \path #1 -- #2 node[at end, below] {$ y $}; | (O)(py)
# special | \path #1 -- #2 node[at end, above] {$ z... | {"/Code/Spherical/__init__.py": ["/Code/Spherical/asciitable.py", "/Code/Spherical/orientation.py", "/Code/Spherical/util.py"]} |
14,421 | chakra34/SphericalOrientations | refs/heads/master | /Code/Spherical/util.py | # -*- coding: UTF-8 no BOM -*-
# obtained from https://damask.mpie.de #
# damask utility functions
import sys,time,random,threading,os,subprocess,shlex
import numpy as np
from optparse import Option
class bcolors:
"""
ASCII Colors (Blender code)
https://svn.blender.org/svnroot/bf-blender/trunk/blend... | {"/Code/Spherical/__init__.py": ["/Code/Spherical/asciitable.py", "/Code/Spherical/orientation.py", "/Code/Spherical/util.py"]} |
14,427 | Kyungpyo-Kang/EV | refs/heads/master | /EV/urls.py | from django.contrib import admin
from django.urls import path
import Main.views
import Community.views
import Introduce.views
import Member.views
import Recommand.views
urlpatterns = [
path('admin/', admin.site.urls),
path('', Main.views.index, name='index'),
path('login/', Member.views.login, name='login'... | {"/EV/urls.py": ["/Community/views.py", "/Member/views.py", "/Recommand/views.py"], "/Member/views.py": ["/Member/models.py"]} |
14,428 | Kyungpyo-Kang/EV | refs/heads/master | /Member/views.py | from django.shortcuts import render, redirect
from .models import Member
from django.contrib.auth.models import User
from django.contrib import auth
def login(request):
return render(request, 'login.html')
def join(request):
return render(request, 'join.html')
def join_pro(request):
if request.method == ... | {"/EV/urls.py": ["/Community/views.py", "/Member/views.py", "/Recommand/views.py"], "/Member/views.py": ["/Member/models.py"]} |
14,429 | Kyungpyo-Kang/EV | refs/heads/master | /Member/models.py | from django.db import models
from django.contrib.auth.models import User
class Member(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
member_name = models.CharField(max_length=50)
member_email = models.CharField(max_length=50)
| {"/EV/urls.py": ["/Community/views.py", "/Member/views.py", "/Recommand/views.py"], "/Member/views.py": ["/Member/models.py"]} |
14,430 | Kyungpyo-Kang/EV | refs/heads/master | /Recommand/views.py | from django.shortcuts import render
def recommand(request):
return render(request, 'recommand.html')
| {"/EV/urls.py": ["/Community/views.py", "/Member/views.py", "/Recommand/views.py"], "/Member/views.py": ["/Member/models.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.